Changeset 2568524
- Timestamp:
- 07/20/2021 08:02:15 PM (5 years ago)
- Location:
- content-visibility-geolocation
- Files:
-
- 10 edited
- 1 copied
-
tags/0.1.1 (copied) (copied from content-visibility-geolocation/trunk)
-
tags/0.1.1/build/index.asset.php (modified) (1 diff)
-
tags/0.1.1/build/index.js (modified) (3 diffs)
-
tags/0.1.1/build/index.js.map (modified) (1 diff)
-
tags/0.1.1/content-visibility-geolocation.php (modified) (1 diff)
-
tags/0.1.1/readme.txt (modified) (2 diffs)
-
trunk/build/index.asset.php (modified) (1 diff)
-
trunk/build/index.js (modified) (3 diffs)
-
trunk/build/index.js.map (modified) (1 diff)
-
trunk/content-visibility-geolocation.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
content-visibility-geolocation/tags/0.1.1/build/index.asset.php
r2510965 r2568524 1 <?php return array('dependencies' => array('react', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => ' 59bda2f99907d79481792ac67e04a6ba');1 <?php return array('dependencies' => array('react', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => '0ac2c687c8251817d4bcab3af2732814'); -
content-visibility-geolocation/tags/0.1.1/build/index.js
r2510965 r2568524 1281 1281 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); 1282 1282 /* harmony import */ var _controls_content_visibility_geolocation_multisitelect__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../controls/content-visibility-geolocation-multisitelect */ "./src/controls/content-visibility-geolocation-multisitelect.js"); 1283 /* harmony import */ var _helpers_has_rules__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/has-rules */ "./src/helpers/has-rules.js"); 1284 1283 1285 1284 1286 … … 1320 1322 var data = getCountries(); 1321 1323 var type = 'geolocation'; 1324 var hasRulesClass = Object(_helpers_has_rules__WEBPACK_IMPORTED_MODULE_5__["default"])(props, type) ? ' has-active-rules' : ''; 1322 1325 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["PanelBody"], { 1323 1326 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Geolocation', 'content-visibility-geolocation'), 1324 1327 initialOpen: false, 1325 className: "content-visibility-control-panel content-visibility-geolocation-controls" 1328 className: "content-visibility-control-panel content-visibility-geolocation-controls" + hasRulesClass 1326 1329 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["PanelRow"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_controls_content_visibility_geolocation_multisitelect__WEBPACK_IMPORTED_MODULE_4__["ContentVisibilityGeolocationMultiSelect"], { 1327 1330 data: data, … … 1432 1435 /***/ }), 1433 1436 1437 /***/ "./src/helpers/has-rules.js": 1438 /*!**********************************!*\ 1439 !*** ./src/helpers/has-rules.js ***! 1440 \**********************************/ 1441 /*! exports provided: default */ 1442 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1443 1444 "use strict"; 1445 __webpack_require__.r(__webpack_exports__); 1446 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); 1447 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__); 1448 1449 /** 1450 * Determine if the passed block props contain rules of the passed type. 1451 * 1452 * @param {object} props The currently selected block's props. 1453 * @param {string} type The type of the rules i.e. userAuthenticated or specialPage (or ones from add-ons). 1454 * 1455 * @return {bool} true if the passed props contain non-empty rules of the passed type. False otherwise. 1456 */ 1457 1458 function hasRules(props, type) { 1459 if (!props.attributes.contentVisibilityRules) { 1460 return false; 1461 } 1462 1463 if (!props.attributes.contentVisibilityRules[type]) { 1464 return false; 1465 } // Default to false. Passed through a filter later. 1466 1467 1468 var hasRules = false; 1469 1470 switch (type) { 1471 case 'geolocation': 1472 if (props.attributes.contentVisibilityRules[type] && props.attributes.contentVisibilityRules[type][type] && props.attributes.contentVisibilityRules[type][type].length >= 1) { 1473 hasRules = true; 1474 } 1475 1476 break; 1477 1478 default: 1479 break; 1480 } 1481 1482 return Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__["applyFilters"])('content-visibility-has-rules', hasRules, props, type); 1483 } // end hasRules() 1484 1485 1486 /* harmony default export */ __webpack_exports__["default"] = (hasRules); 1487 1488 /***/ }), 1489 1434 1490 /***/ "./src/index.js": 1435 1491 /*!**********************!*\ -
content-visibility-geolocation/tags/0.1.1/build/index.js.map
r2510965 r2568524 1 {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/@babel/runtime/helpers/defineProperty.js","webpack:///./node_modules/goober/dist/goober.esm.js","webpack:///./node_modules/react-multi-select-component/dist/react-multi-select-component.esm.js","webpack:///./src/controls/content-visibility-geolocation-multisitelect.js","webpack:///./src/controls/content-visibility-geolocation-panel-body.js","webpack:///./src/controls/content-visibility-geolocation.js","webpack:///./src/editor.scss","webpack:///./src/ index.js","webpack:///external {\"this\":[\"wp\",\"components\"]}","webpack:///external {\"this\":[\"wp\",\"compose\"]}","webpack:///external {\"this\":[\"wp\",\"element\"]}","webpack:///external {\"this\":[\"wp\",\"hooks\"]}","webpack:///external {\"this\":[\"wp\",\"i18n\"]}","webpack:///external {\"this\":[\"wp\",\"plugins\"]}","webpack:///external {\"this\":\"React\"}"],"names":["ContentVisibilityGeolocationMultiSelect","withState","option","setState","props","data","labelledBy","type","onChange","setAttributes","contentVisibilityRules","attributes","geolocation","checked","onClick","disabled","icon","label","getCountries","countries","BlockVisibilityGeolocation","length","__","value","notes","country","push","flag","name","code","ContentVisibilityGeolocationBodyControl","instanceId","contentVisibility","withInstanceId","ContentVisibilityGeolocationControl","rulesEnabled","contentVisibilityRulesEnabled","hasOwnProperty","ContentVisibilityGeolocationFill","fillProps","registerPlugin","render","addFilter","registerContentVisibilityRule","defaultRules"],"mappings":";;;;;;;;;;;;;;;;QAAA;QACA;QACA;QACA;QACA;;QAEA;QACA;QACA;QACA,QAAQ,oBAAoB;QAC5B;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA,iBAAiB,4BAA4B;QAC7C;QACA;QACA,kBAAkB,2BAA2B;QAC7C;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;;QAEA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;QAEA;QACA;QACA;QACA;QACA,gBAAgB,uBAAuB;QACvC;;;QAGA;QACA;QACA;QACA;;;;;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA;;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;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,eAAe,cAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA,GAAG,mCAAmC;AACtC;AACA;;;AAGA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,iBAAiB,cAAc;AAC/B;AACA;;AAEA,iBAAiB,cAAc;AAC/B;AACA,GAAG;;;AAGH,kBAAkB,eAAe;AACjC,oBAAoB,eAAe;AACnC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;;AAEA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA,GAAG,GAAG,4CAAK;AACX;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA,mCAAmC,kDAAG;AACtC;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,SAAS,4CAAK;AACd;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA;AACA,GAAG,GAAG,4CAAK;AACX;;AAEA;AACA;AACA;AACA,iCAAiC,kDAAG;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oDAAM;AACtB,EAAE,uDAAS;AACX,kBAAkB;AAClB,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,gCAAgC,kDAAG;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA,SAAS,4CAAK;AACd;AACA,GAAG;AACH;AACA,WAAW,4CAAK;AAChB;AACA,KAAK,EAAE,4CAAK;AACZ;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC,8BAA8B;;AAE/B,yCAAyC,kDAAG;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qCAAqC,kDAAG;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,sDAAQ;AAC1B;AACA;;AAEA,mBAAmB,sDAAQ;AAC3B;AACA;;AAEA,mBAAmB,sDAAQ;AAC3B;AACA;;AAEA,wBAAwB,yDAAW;AACnC;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;;AAEL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,qDAAO;AACxB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP,KAAK,qCAAqC;AAC1C,GAAG;AACH;AACA;;AAEA,SAAS,4CAAK;AACd;AACA;AACA;AACA,GAAG,oBAAoB,4CAAK;AAC5B;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG,GAAG,4CAAK;AACX;AACA;AACA;AACA;AACA;AACA,GAAG,eAAe,4CAAK,uEAAuE,4CAAK;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG,GAAG,4CAAK;AACX;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA,wBAAwB,4CAAK;AAC7B;AACA,GAAG,wCAAwC,4CAAK;AAChD;;AAEA,2BAA2B,kDAAG;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,kCAAkC,kDAAG;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qCAAqC,kDAAG;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,mCAAmC,kDAAG;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,uCAAuC,kDAAG;AAC1C;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,sDAAQ;AAC1B;AACA;;AAEA,mBAAmB,sDAAQ;AAC3B;AACA;;AAEA,mBAAmB,sDAAQ;AAC3B;AACA;;AAEA;AACA,gBAAgB,oDAAM;AACtB;;AAEA,EAAE,uDAAS;AACX;AACA,GAAG;AACH,EAAE,uDAAS;AACX;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;A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ACApD,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,gCAAgC,EAAE,I","file":"index.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"index\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([\"./src/index.js\",\"style-index\"]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","let e={data:\"\"},t=t=>{if(\"undefined\"!=typeof window){let e=t?t.querySelector(\"#_goober\"):window._goober;return e||(e=(t||document.head).appendChild(document.createElement(\"style\")),e.innerHTML=\" \",e.id=\"_goober\"),e.firstChild}return t||e},r=e=>{let r=t(e),l=r.data;return r.data=\"\",l},l=/(?:([A-Z0-9-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(})/gi,a=/\\/\\*[\\s\\S]*?\\*\\/|\\s{2,}|\\n/gm,n=(e,t)=>{let r,l=\"\",a=\"\",o=\"\";for(let c in e){let s=e[c];\"object\"==typeof s?(r=t?t.replace(/([^,])+/g,e=>c.replace(/([^,])+/g,t=>/&/g.test(t)?t.replace(/&/g,e):e?e+\" \"+t:t)):c,a+=\"@\"==c[0]?\"f\"==c[1]?n(s,c):c+\"{\"+n(s,\"k\"==c[1]?\"\":t)+\"}\":n(s,r)):\"@\"==c[0]&&\"i\"==c[1]?l=c+\" \"+s+\";\":o+=n.p?n.p(c.replace(/[A-Z]/g,\"-$&\").toLowerCase(),s):c.replace(/[A-Z]/g,\"-$&\").toLowerCase()+\":\"+s+\";\"}return o[0]?(r=t?t+\"{\"+o+\"}\":o,l+r+a):l+a},o={},c=e=>{let t=\"\";for(let r in e)t+=r+(\"object\"==typeof e[r]?c(e[r]):e[r]);return t},s=(e,t,r,s,i)=>{let p=\"object\"==typeof e?c(e):e,u=o[p]||(o[p]=\"go\"+p.split(\"\").reduce((e,t)=>101*e+t.charCodeAt(0)>>>0,11));if(!o[u]){let t=\"object\"==typeof e?e:(e=>{let t,r=[{}];for(;t=l.exec(e.replace(a,\"\"));)t[4]&&r.shift(),t[3]?r.unshift(r[0][t[3]]=r[0][t[3]]||{}):t[4]||(r[0][t[1]]=t[2]);return r[0]})(e);o[u]=n(i?{[\"@keyframes \"+u]:t}:t,r?\"\":\".\"+u)}return((e,t,r)=>{-1==t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e)})(o[u],t,s),u},i=(e,t,r)=>e.reduce((e,l,a)=>{let o=t[a];if(o&&o.call){let e=o(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?\".\"+t:e&&\"object\"==typeof e?e.props?\"\":n(e,\"\"):e}return e+l+(null==o?\"\":o)},\"\");function p(e){let r=this||{},l=e.call?e(r.p):e;return s(l.unshift?l.raw?i(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>t?Object.assign(e,t.call?t(r.p):t):e,{}):l,t(r.target),r.g,r.o,r.k)}let u,d,f,g=p.bind({g:1}),b=p.bind({k:1});function h(e,t,r,l){n.p=t,u=e,d=r,f=l}function m(e,t){let r=this||{};return function(){let l=arguments;function a(n,o){let c=Object.assign({},n),s=c.className||a.className;r.p=Object.assign({theme:d&&d()},c),r.o=/ *go\\d+/g.test(s),c.className=p.apply(r,l)+(s?\" \"+s:\"\"),t&&(c.ref=o);let i=c.as||e;return f&&i[0]&&f(c),u(i,c)}return t?t(a):a}}export{p as css,r as extractCss,g as glob,b as keyframes,h as setup,m as styled};\n","import { css } from 'goober';\nimport React, { useRef, useEffect, useState, useCallback, useMemo } from 'react';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nvar defaultStrings = {\n selectSomeItems: \"Select...\",\n allItemsAreSelected: \"All items are selected.\",\n selectAll: \"Select All\",\n search: \"Search\",\n clearSearch: \"Clear Search\",\n clearSelected: \"Clear Selected\"\n};\nvar defaultProps = {\n value: [],\n focusSearchOnOpen: true,\n hasSelectAll: true,\n className: \"multi-select\",\n debounceDuration: 300,\n options: []\n};\nvar MultiSelectContext = /*#__PURE__*/React.createContext({});\nvar MultiSelectProvider = function MultiSelectProvider(_ref) {\n var props = _ref.props,\n children = _ref.children;\n\n var t = function t(key) {\n var _props$overrideString;\n\n return ((_props$overrideString = props.overrideStrings) == null ? void 0 : _props$overrideString[key]) || defaultStrings[key];\n };\n\n return React.createElement(MultiSelectContext.Provider, {\n value: _extends({\n t: t\n }, defaultProps, props)\n }, children);\n};\nvar useMultiSelect = function useMultiSelect() {\n return React.useContext(MultiSelectContext);\n};\n\n/**\r\n * combines classNames in a friendly way\r\n *\r\n * @param {*} classes\r\n */\nvar cn = function cn() {\n for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) {\n classes[_key] = arguments[_key];\n }\n\n return classes.join(\" \");\n};\n\nvar debounce = function debounce(func, wait) {\n var timeout;\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n func.apply(null, args);\n }, wait);\n };\n};\n\n/**\r\n * Filters React Select options and sorts by similarity to a search filter.\r\n * Handles partial matches, eg. searching for \"Waberg High\" will find \"Raoul\r\n * Wallenberg Traditional High School\". Case insensitive. Ignores\r\n * non-alphanumeric characters.\r\n *\r\n * @param options An unfiltered list of Options.\r\n * @param? filter A string to compare against Option labels.\r\n * @param? substitutions Strings with multiple spellings or variations that we\r\n * expect to match, eg. accented characters or abbreviated words.\r\n *\r\n * @return A filtered and sorted array of Options.\r\n */\nfunction filterOptions(options, filter, substitutions) {\n // If the filter is blank, return the full list of Options.\n if (!filter) {\n return options;\n }\n\n var cleanFilter = cleanUpText(filter, substitutions);\n return options // Filter out undefined or null Options.\n .filter(function (_ref) {\n var label = _ref.label,\n value = _ref.value;\n return label != null && value != null;\n }) // Create a {score, Option} pair for each Option based on its label's\n // similarity to the filter text.\n .map(function (option) {\n return {\n option: option,\n score: typeaheadSimilarity(cleanUpText(option.label, substitutions), cleanFilter)\n };\n }) // Only include matches of the entire substring, with a slight\n // affordance for transposition or extra characters.\n .filter(function (pair) {\n return pair.score >= cleanFilter.length - 2;\n }) // Sort 'em by order of their score.\n .sort(function (a, b) {\n return b.score - a.score;\n }) // …and grab the original Options back from their pairs.\n .map(function (pair) {\n return pair.option;\n });\n}\n/**\r\n * Scores the similarity between two strings by returning the length of the\r\n * longest common subsequence. Intended for comparing strings of different\r\n * lengths; eg. when matching a typeahead search input with a school name.\r\n\n * Meant for use in an instant search box where results are being fetched\r\n * as a user is typing.\r\n *\r\n * @param a The longer string (though, we flip them if it's shorter).\r\n * @param b The shorter string, eg. a typeahead search input.\r\n *\r\n * @return The length of the longest common subsequence. Higher scores indicate\r\n * closer matches.\r\n */\n\nfunction typeaheadSimilarity(a, b) {\n var aLength = a.length;\n var bLength = b.length;\n var table = [];\n\n if (!aLength || !bLength) {\n return 0;\n } // Ensure `a` isn't shorter than `b`.\n\n\n if (aLength < bLength) {\n var _ref2 = [b, a];\n a = _ref2[0];\n b = _ref2[1];\n } // Early exit if `a` includes `b`; these will be scored higher than any\n // other options with the same `b` (filter string), with a preference for\n // shorter `a` strings (option labels).\n\n\n if (a.indexOf(b) !== -1) {\n return bLength + 1 / aLength;\n } // Initialize the table axes:\n //\n // 0 0 0 0 ... bLength\n // 0\n // 0\n //\n // ...\n //\n // aLength\n //\n\n\n for (var x = 0; x <= aLength; ++x) {\n table[x] = [0];\n }\n\n for (var y = 0; y <= bLength; ++y) {\n table[0][y] = 0;\n } // Populate the rest of the table with a dynamic programming algorithm.\n\n\n for (var _x = 1; _x <= aLength; ++_x) {\n for (var _y = 1; _y <= bLength; ++_y) {\n table[_x][_y] = a[_x - 1] === b[_y - 1] ? 1 + table[_x - 1][_y - 1] : Math.max(table[_x][_y - 1], table[_x - 1][_y]);\n }\n }\n\n return table[aLength][bLength];\n}\n/**\r\n * Apply string substitutions, remove non-alphanumeric characters, and convert\r\n * all letters to uppercase.\r\n *\r\n * eg. 'Scoil Bhríde Primary School' may become 'SCOILBHRIDEPRIMARYSCHOOL'.\r\n *\r\n * @param input An unsanitized input string.\r\n * @param substitutions Strings with multiple spellings or variations that we\r\n * expect to match, for example accented characters or abbreviated\r\n * words.\r\n *\r\n * @return The sanitized text.\r\n */\n\nfunction cleanUpText(input, substitutions) {\n if (!input) {\n return \"\";\n } // Uppercase and remove all non-alphanumeric, non-accented characters.\n // Also remove underscores.\n\n\n input = input.toUpperCase().replace(/((?=[^\\u00E0-\\u00FC])\\W)|_/g, \"\");\n\n if (!substitutions) {\n return input;\n }\n\n var safeSubstitutions = substitutions; // For Flow.\n // Replace all strings in `safeSubstitutions` with their standardized\n // counterparts.\n\n return Object.keys(safeSubstitutions).reduce(function (output, substitution) {\n var unsubbed = new RegExp(substitution, \"g\");\n return output.replace(unsubbed, safeSubstitutions[substitution]);\n }, input);\n}\n\nvar Cross = function Cross() {\n return React.createElement(\"svg\", {\n width: \"24\",\n height: \"24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"2\",\n className: \"dropdown-search-clear-icon gray\"\n }, React.createElement(\"line\", {\n x1: \"18\",\n y1: \"6\",\n x2: \"6\",\n y2: \"18\"\n }), React.createElement(\"line\", {\n x1: \"6\",\n y1: \"6\",\n x2: \"18\",\n y2: \"18\"\n }));\n};\n\nvar DefaultRenderer = /*#__PURE__*/css({\n \"& input,& span\": {\n verticalAlign: \"middle\",\n margin: 0\n },\n span: {\n display: \"inline-block\",\n paddingLeft: \"5px\"\n },\n \"&.disabled\": {\n opacity: 0.5\n }\n});\n\nvar DefaultItemRenderer = function DefaultItemRenderer(_ref) {\n var checked = _ref.checked,\n option = _ref.option,\n onClick = _ref.onClick,\n disabled = _ref.disabled;\n return React.createElement(\"div\", {\n className: cn(DefaultRenderer, \"item-renderer\", disabled && \"disabled\")\n }, React.createElement(\"input\", {\n type: \"checkbox\",\n onChange: onClick,\n checked: checked,\n tabIndex: -1,\n disabled: disabled\n }), React.createElement(\"span\", null, option.label));\n};\n\n/**\r\n * This component represents an individual item in the multi-select drop-down\r\n */\nvar ItemContainer = /*#__PURE__*/css({\n boxSizing: \"border-box\",\n cursor: \"pointer\",\n display: \"block\",\n padding: \"var(--rmsc-p)\",\n outline: 0,\n \"&:hover,&:focus\": {\n background: \"var(--rmsc-hover)\"\n },\n \"&.selected\": {\n background: \"var(--rmsc-selected)\"\n }\n});\n\nvar SelectItem = function SelectItem(_ref) {\n var _ref$itemRenderer = _ref.itemRenderer,\n ItemRenderer = _ref$itemRenderer === void 0 ? DefaultItemRenderer : _ref$itemRenderer,\n option = _ref.option,\n checked = _ref.checked,\n focused = _ref.focused,\n tabIndex = _ref.tabIndex,\n disabled = _ref.disabled,\n onSelectionChanged = _ref.onSelectionChanged,\n onClick = _ref.onClick;\n var itemRef = useRef();\n useEffect(function () {\n updateFocus(); // eslint-disable-next-line\n }, [checked, focused]);\n\n var toggleChecked = function toggleChecked() {\n onSelectionChanged(!checked);\n };\n\n var handleClick = function handleClick(e) {\n toggleChecked();\n onClick(e);\n };\n\n var updateFocus = function updateFocus() {\n if (focused && !disabled && itemRef) {\n itemRef.current.focus();\n }\n };\n\n var handleKeyDown = function handleKeyDown(e) {\n switch (e.which) {\n case 13: // Enter\n\n case 32:\n // Space\n toggleChecked();\n break;\n\n default:\n return;\n }\n\n e.preventDefault();\n };\n\n return React.createElement(\"label\", {\n className: cn(ItemContainer, \"select-item\", checked && \"selected\"),\n role: \"option\",\n \"aria-selected\": checked,\n tabIndex: tabIndex,\n ref: itemRef,\n onKeyDown: handleKeyDown\n }, React.createElement(ItemRenderer, {\n option: option,\n checked: checked,\n onClick: handleClick,\n disabled: disabled\n }));\n};\n\n/**\r\n * This component represents an unadorned list of SelectItem (s).\r\n */\nvar SelectListUl = /*#__PURE__*/css({\n margin: 0,\n paddingLeft: 0,\n li: {\n listStyle: \"none\",\n margin: 0\n }\n});\nvar skipIndex = 2;\n\nvar SelectList = function SelectList(_ref) {\n var options = _ref.options,\n focusIndex = _ref.focusIndex,\n _onClick = _ref.onClick;\n\n var _useMultiSelect = useMultiSelect(),\n disabled = _useMultiSelect.disabled,\n value = _useMultiSelect.value,\n onChange = _useMultiSelect.onChange,\n ItemRenderer = _useMultiSelect.ItemRenderer;\n\n var handleSelectionChanged = function handleSelectionChanged(option, checked) {\n if (disabled) {\n return;\n }\n\n onChange(checked ? [].concat(value, [option]) : value.filter(function (o) {\n return o.value !== option.value;\n }));\n };\n\n return React.createElement(\"ul\", {\n className: SelectListUl\n }, options.map(function (o, i) {\n var tabIndex = i + skipIndex;\n return React.createElement(\"li\", {\n key: (o == null ? void 0 : o.key) || i\n }, React.createElement(SelectItem, {\n focused: focusIndex === tabIndex,\n tabIndex: tabIndex,\n option: o,\n onSelectionChanged: function onSelectionChanged(c) {\n return handleSelectionChanged(o, c);\n },\n checked: value.find(function (s) {\n return s.value === o.value;\n }) ? true : false,\n onClick: function onClick(e) {\n return _onClick(e, tabIndex);\n },\n itemRenderer: ItemRenderer,\n disabled: o.disabled || disabled\n }));\n }));\n};\n\n/**\r\n * This component represents the entire panel which gets dropped down when the\r\n * user selects the component. It encapsulates the search filter, the\r\n * Select-all item, and the list of options.\r\n */\nvar FocusType;\n\n(function (FocusType) {\n FocusType[FocusType[\"SEARCH\"] = -1] = \"SEARCH\";\n FocusType[FocusType[\"NONE\"] = 1] = \"NONE\";\n})(FocusType || (FocusType = {}));\n\nvar SelectSearchContainer = /*#__PURE__*/css({\n width: \"100%\",\n position: \"relative\",\n borderBottom: \"1px solid var(--rmsc-border)\",\n input: {\n height: \"var(--rmsc-h)\",\n padding: \"0 var(--rmsc-p)\",\n width: \"100%\",\n outline: 0,\n border: 0\n }\n});\nvar SearchClearButton = /*#__PURE__*/css({\n cursor: \"pointer\",\n position: \"absolute\",\n top: 0,\n right: 0,\n bottom: 0,\n background: \"none\",\n border: 0,\n padding: \"0 calc(var(--rmsc-p)/2)\",\n \"[hidden]\": {\n display: \"none\"\n }\n});\n\nvar SelectPanel = function SelectPanel() {\n var _useMultiSelect = useMultiSelect(),\n t = _useMultiSelect.t,\n onChange = _useMultiSelect.onChange,\n options = _useMultiSelect.options,\n value = _useMultiSelect.value,\n customFilterOptions = _useMultiSelect.filterOptions,\n selectAllLabel = _useMultiSelect.selectAllLabel,\n ItemRenderer = _useMultiSelect.ItemRenderer,\n disabled = _useMultiSelect.disabled,\n disableSearch = _useMultiSelect.disableSearch,\n focusSearchOnOpen = _useMultiSelect.focusSearchOnOpen,\n hasSelectAll = _useMultiSelect.hasSelectAll,\n ClearIcon = _useMultiSelect.ClearIcon,\n debounceDuration = _useMultiSelect.debounceDuration;\n\n var _useState = useState(\"\"),\n searchText = _useState[0],\n setSearchText = _useState[1];\n\n var _useState2 = useState(\"\"),\n searchTextForFilter = _useState2[0],\n setSearchTextForFilter = _useState2[1];\n\n var _useState3 = useState(focusSearchOnOpen && !disableSearch ? FocusType.SEARCH : FocusType.NONE),\n focusIndex = _useState3[0],\n setFocusIndex = _useState3[1];\n\n var debouncedSearch = useCallback(debounce(function (query) {\n return setSearchTextForFilter(query);\n }, debounceDuration), []);\n var selectAllOption = {\n label: selectAllLabel || t(\"selectAll\"),\n value: \"\"\n };\n\n var selectAllValues = function selectAllValues(checked) {\n var filteredValues = filteredOptions().filter(function (o) {\n return !o.disabled;\n }).map(function (o) {\n return o.value;\n });\n\n if (checked) {\n var selectedValues = value.map(function (o) {\n return o.value;\n });\n var finalSelectedValues = [].concat(selectedValues, filteredValues);\n return options.filter(function (o) {\n return finalSelectedValues.includes(o.value);\n });\n }\n\n return value.filter(function (o) {\n return !filteredValues.includes(o.value);\n });\n };\n\n var selectAllChanged = function selectAllChanged(checked) {\n var newOptions = selectAllValues(checked);\n onChange(newOptions);\n };\n\n var handleSearchChange = function handleSearchChange(e) {\n debouncedSearch(e.target.value);\n setSearchText(e.target.value);\n setFocusIndex(FocusType.SEARCH);\n };\n\n var handleClear = function handleClear() {\n setSearchTextForFilter(\"\");\n setSearchText(\"\");\n };\n\n var handleItemClicked = function handleItemClicked(index) {\n return setFocusIndex(index);\n };\n\n var handleKeyDown = function handleKeyDown(e) {\n switch (e.which) {\n case 38:\n // Up Arrow\n if (e.altKey) {\n return;\n }\n\n updateFocus(-1);\n break;\n\n case 40:\n // Down Arrow\n if (e.altKey) {\n return;\n }\n\n updateFocus(1);\n break;\n\n default:\n return;\n }\n\n e.stopPropagation();\n e.preventDefault();\n };\n\n var handleSearchFocus = function handleSearchFocus() {\n setFocusIndex(FocusType.SEARCH);\n };\n\n var filteredOptions = function filteredOptions() {\n return customFilterOptions ? customFilterOptions(options, searchTextForFilter) : filterOptions(options, searchTextForFilter);\n };\n\n var updateFocus = function updateFocus(offset) {\n var newFocus = focusIndex + offset;\n newFocus = Math.max(1, newFocus);\n newFocus = Math.min(newFocus, options.length + 1);\n setFocusIndex(newFocus);\n };\n\n var _useMemo = useMemo(function () {\n var filteredOptionsList = filteredOptions().filter(function (o) {\n return !o.disabled;\n });\n return [filteredOptionsList.every(function (o) {\n return value.findIndex(function (v) {\n return v.value === o.value;\n }) !== -1;\n }), filteredOptionsList.length !== 0]; // eslint-disable-next-line\n }, [searchText, value]),\n isAllOptionSelected = _useMemo[0],\n hasSelectableOptions = _useMemo[1];\n\n return React.createElement(\"div\", {\n className: \"select-panel\",\n role: \"listbox\",\n onKeyDown: handleKeyDown\n }, !disableSearch && React.createElement(\"div\", {\n className: SelectSearchContainer\n }, React.createElement(\"input\", {\n autoFocus: focusSearchOnOpen,\n placeholder: t(\"search\"),\n type: \"text\",\n \"aria-describedby\": t(\"search\"),\n onKeyDown: function onKeyDown(e) {\n return e.stopPropagation();\n },\n onChange: handleSearchChange,\n onFocus: handleSearchFocus,\n value: searchText\n }), React.createElement(\"button\", {\n type: \"button\",\n className: cn(SearchClearButton, \"search-clear-button\"),\n hidden: !searchText,\n onClick: handleClear,\n \"aria-label\": t(\"clearSearch\")\n }, ClearIcon || React.createElement(Cross, null))), hasSelectAll && hasSelectableOptions && React.createElement(SelectItem, {\n focused: focusIndex === 1,\n tabIndex: 1,\n checked: isAllOptionSelected,\n option: selectAllOption,\n onSelectionChanged: selectAllChanged,\n onClick: function onClick() {\n return handleItemClicked(1);\n },\n itemRenderer: ItemRenderer,\n disabled: disabled\n }), React.createElement(SelectList, {\n options: filteredOptions(),\n focusIndex: focusIndex,\n onClick: function onClick(_e, index) {\n return handleItemClicked(index);\n }\n }));\n};\n\nvar Arrow = function Arrow(_ref) {\n var expanded = _ref.expanded;\n return React.createElement(\"svg\", {\n width: \"24\",\n height: \"24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"2\",\n className: \"dropdown-heading-dropdown-arrow gray\"\n }, React.createElement(\"path\", {\n d: expanded ? \"M18 15 12 9 6 15\" : \"M6 9L12 15 18 9\"\n }));\n};\n\nvar DropdownHeader = function DropdownHeader() {\n var _useMultiSelect = useMultiSelect(),\n t = _useMultiSelect.t,\n value = _useMultiSelect.value,\n options = _useMultiSelect.options,\n valueRenderer = _useMultiSelect.valueRenderer;\n\n var noneSelected = value.length === 0;\n var allSelected = value.length === options.length;\n var customText = valueRenderer && valueRenderer(value, options);\n\n var getSelectedText = function getSelectedText() {\n return value.map(function (s) {\n return s.label;\n }).join(\", \");\n };\n\n return noneSelected ? React.createElement(\"span\", {\n className: \"gray\"\n }, customText || t(\"selectSomeItems\")) : React.createElement(\"span\", null, customText || (allSelected ? t(\"allItemsAreSelected\") : getSelectedText()));\n};\n\nvar Spinner = /*#__PURE__*/css({\n animation: \"rotate 2s linear infinite\",\n \"& .path\": {\n stroke: \"var(--rmsc-border)\",\n strokeWidth: \"4px\",\n strokeLinecap: \"round\",\n animation: \"dash 1.5s ease-in-out infinite\"\n },\n \"@keyframes rotate\": {\n \"100%\": {\n transform: \"rotate(360deg)\"\n }\n },\n \"@keyframes dash\": {\n \"0%\": {\n strokeDasharray: \"1,150\",\n strokeDashoffset: 0\n },\n \"50%\": {\n strokeDasharray: \"90,150\",\n strokeDashoffset: \"-35\"\n },\n \"100%\": {\n strokeDasharray: \"90,150\",\n strokeDashoffset: \"-124\"\n }\n }\n});\nvar Loading = function Loading(_ref) {\n var _ref$size = _ref.size,\n size = _ref$size === void 0 ? 24 : _ref$size;\n return React.createElement(\"span\", {\n style: {\n width: size,\n marginRight: \"0.2rem\"\n }\n }, React.createElement(\"svg\", {\n width: size,\n height: size,\n className: Spinner,\n viewBox: \"0 0 50 50\",\n style: {\n display: \"inline\",\n verticalAlign: \"middle\"\n }\n }, React.createElement(\"circle\", {\n cx: \"25\",\n cy: \"25\",\n r: \"20\",\n fill: \"none\",\n className: \"path\"\n })));\n};\n\n/**\r\n * A generic dropdown component. It takes the children of the component\r\n * and hosts it in the component. When the component is selected, it\r\n * drops-down the contentComponent and applies the contentProps.\r\n */\nvar PanelContainer = /*#__PURE__*/css({\n position: \"absolute\",\n zIndex: 1,\n top: \"100%\",\n width: \"100%\",\n paddingTop: \"8px\",\n \".panel-content\": {\n maxHeight: \"300px\",\n overflowY: \"auto\",\n borderRadius: \"var(--rmsc-radius)\",\n background: \"var(--rmsc-bg)\",\n boxShadow: \"0 0 0 1px rgba(0, 0, 0, 0.1), 0 4px 11px rgba(0, 0, 0, 0.1)\"\n }\n});\nvar DropdownContainer = /*#__PURE__*/css({\n position: \"relative\",\n outline: 0,\n backgroundColor: \"var(--rmsc-bg)\",\n border: \"1px solid var(--rmsc-border)\",\n borderRadius: \"var(--rmsc-radius)\",\n \"&:focus-within\": {\n boxShadow: \"var(--rmsc-main) 0 0 0 1px\",\n borderColor: \"var(--rmsc-main)\"\n }\n});\nvar DropdownHeading = /*#__PURE__*/css({\n position: \"relative\",\n padding: \"0 var(--rmsc-p)\",\n display: \"flex\",\n alignItems: \"center\",\n width: \"100%\",\n height: \"var(--rmsc-h)\",\n cursor: \"default\",\n outline: 0,\n \".dropdown-heading-value\": {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n flex: 1\n }\n});\nvar ClearSelectedButton = /*#__PURE__*/css({\n cursor: \"pointer\",\n background: \"none\",\n border: 0,\n padding: 0,\n display: \"flex\"\n});\n\nvar Dropdown = function Dropdown() {\n var _useMultiSelect = useMultiSelect(),\n t = _useMultiSelect.t,\n onMenuToggle = _useMultiSelect.onMenuToggle,\n ArrowRenderer = _useMultiSelect.ArrowRenderer,\n shouldToggleOnHover = _useMultiSelect.shouldToggleOnHover,\n isLoading = _useMultiSelect.isLoading,\n disabled = _useMultiSelect.disabled,\n onChange = _useMultiSelect.onChange,\n labelledBy = _useMultiSelect.labelledBy,\n value = _useMultiSelect.value,\n isOpen = _useMultiSelect.isOpen,\n defaultIsOpen = _useMultiSelect.defaultIsOpen,\n ClearSelectedIcon = _useMultiSelect.ClearSelectedIcon;\n\n var _useState = useState(true),\n isInternalExpand = _useState[0],\n setIsInternalExpand = _useState[1];\n\n var _useState2 = useState(defaultIsOpen),\n expanded = _useState2[0],\n setExpanded = _useState2[1];\n\n var _useState3 = useState(false),\n hasFocus = _useState3[0],\n setHasFocus = _useState3[1];\n\n var FinalArrow = ArrowRenderer || Arrow;\n var wrapper = useRef();\n /* eslint-disable react-hooks/exhaustive-deps */\n\n useEffect(function () {\n onMenuToggle && onMenuToggle(expanded);\n }, [expanded]);\n useEffect(function () {\n if (defaultIsOpen === undefined && typeof isOpen === \"boolean\") {\n setIsInternalExpand(false);\n setExpanded(isOpen);\n }\n }, [isOpen]);\n\n var handleKeyDown = function handleKeyDown(e) {\n var _wrapper$current;\n\n if (isInternalExpand) {\n switch (e.which) {\n case 27: // Escape\n\n case 38:\n // Up Arrow\n setExpanded(false);\n wrapper == null ? void 0 : (_wrapper$current = wrapper.current) == null ? void 0 : _wrapper$current.focus();\n break;\n\n case 32: // Space\n\n case 13: // Enter Key\n\n case 40:\n // Down Arrow\n setExpanded(true);\n break;\n\n default:\n return;\n }\n }\n\n e.preventDefault();\n };\n\n var handleHover = function handleHover(iexpanded) {\n isInternalExpand && shouldToggleOnHover && setExpanded(iexpanded);\n };\n\n var handleFocus = function handleFocus() {\n return !hasFocus && setHasFocus(true);\n };\n\n var handleBlur = function handleBlur(e) {\n if (!e.currentTarget.contains(e.relatedTarget) && isInternalExpand) {\n setHasFocus(false);\n setExpanded(false);\n }\n };\n\n var handleMouseEnter = function handleMouseEnter() {\n return handleHover(true);\n };\n\n var handleMouseLeave = function handleMouseLeave() {\n return handleHover(false);\n };\n\n var toggleExpanded = function toggleExpanded() {\n isInternalExpand && setExpanded(isLoading || disabled ? false : !expanded);\n };\n\n var handleClearSelected = function handleClearSelected(e) {\n e.stopPropagation();\n onChange([]);\n isInternalExpand && setExpanded(false);\n };\n\n return React.createElement(\"div\", {\n tabIndex: 0,\n className: cn(DropdownContainer, \"dropdown-container\"),\n \"aria-labelledby\": labelledBy,\n \"aria-expanded\": expanded,\n \"aria-readonly\": true,\n \"aria-disabled\": disabled,\n ref: wrapper,\n onKeyDown: handleKeyDown,\n onFocus: handleFocus,\n onBlur: handleBlur,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave\n }, React.createElement(\"div\", {\n className: cn(DropdownHeading, \"dropdown-heading\"),\n onClick: toggleExpanded\n }, React.createElement(\"div\", {\n className: \"dropdown-heading-value\"\n }, React.createElement(DropdownHeader, null)), isLoading && React.createElement(Loading, null), value.length > 0 && React.createElement(\"button\", {\n type: \"button\",\n className: cn(ClearSelectedButton, \"clear-selected-button\"),\n onClick: handleClearSelected,\n disabled: disabled,\n \"aria-label\": t(\"clearSelected\")\n }, ClearSelectedIcon || React.createElement(Cross, null)), React.createElement(FinalArrow, {\n expanded: expanded\n })), expanded && React.createElement(\"div\", {\n className: cn(PanelContainer, \"dropdown-content\")\n }, React.createElement(\"div\", {\n className: \"panel-content\"\n }, React.createElement(SelectPanel, null))));\n};\n\nvar MultiSelectBox = /*#__PURE__*/css({\n \"--rmscMain\": \"#4285f4\",\n \"--rmscHover\": \"#f1f3f5\",\n \"--rmscSelected\": \"#e2e6ea\",\n \"--rmscBorder\": \"#ccc\",\n \"--rmscGray\": \"#aaa\",\n \"--rmscBg\": \"#fff\",\n \"--rmscP\": \"10px\",\n \"--rmscRadius\": \"4px\",\n \"--rmscH\": \"38px\",\n \"*\": {\n boxSizing: \"border-box\",\n transition: \"all 0.2s ease\"\n },\n \".gray\": {\n color: \"var(--rmsc-gray)\"\n }\n});\n\nvar MultiSelect = function MultiSelect(props) {\n return React.createElement(MultiSelectProvider, {\n props: props\n }, React.createElement(\"div\", {\n className: cn(MultiSelectBox, props.className || \"multi-select\")\n }, React.createElement(Dropdown, null)));\n};\n\nexport default MultiSelect;\nexport { Dropdown, SelectItem, SelectPanel };\n//# sourceMappingURL=react-multi-select-component.esm.js.map\n","import MultiSelect from \"react-multi-select-component\";\nimport { withState } from '@wordpress/compose';\n\nexport const ContentVisibilityGeolocationMultiSelect = withState( {\n option: [],\n} )( ( { option, setState, props, data, labelledBy, type } ) => {\n\n /**\n * onChange callback for the ContentVisibilityMultiSelect component. This handles setting the props and state for\n * this instance of the component.\n * \n * @param {array} option current value of what is selected.\n */\n const onChange = ( option ) => {\n\n // Set the state and props.\n setState( { option } );\n\n props.setAttributes( {\n contentVisibilityRules: {\n ...props.attributes.contentVisibilityRules,\n geolocation: {\n ...props.attributes.contentVisibilityRules.geolocation,\n [type]: option\n }\n },\n } );\n\n };\n\n return (\n <div className=\"content-visibility-multi-select\">\n <MultiSelect\n options={ data }\n value={ props.attributes.contentVisibilityRules.geolocation[type] || option }\n onChange={ onChange }\n labelledBy={ labelledBy }\n ItemRenderer={ ( { checked, option, onClick, disabled, } ) => {\n return (\n <div className={`item-renderer content-visibility-multi-select-item ${disabled && \"disabled\"}`}>\n <input type=\"checkbox\" onChange={ onClick } checked={ checked } tabIndex={ -1 } disabled={ disabled } />\n <span>{option.icon || \"\"} {option.label}</span>\n </div>\n );\n } }\n // isOpen={ true }\n />\n </div>\n );\n\n} );","import { PanelBody, PanelRow } from '@wordpress/components';\nimport { withInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\nimport { ContentVisibilityGeolocationMultiSelect } from '../controls/content-visibility-geolocation-multisitelect';\n\n/**\n * PHP sends through a list of all the users on the site. We massage that data to be\n * usable by our Dropdown.\n *\n */\nfunction getCountries() {\n\n const countries = [];\n\n if ( BlockVisibilityGeolocation.countries.length === 0 ) {\n return [ {\n label: __( 'No countries found.', 'content-visibility' ),\n value: 0,\n notes: '',\n } ]\n }\n\n for ( const country in BlockVisibilityGeolocation.countries ) {\n \n countries.push( { \n icon: BlockVisibilityGeolocation.countries[country].flag,\n label: BlockVisibilityGeolocation.countries[country].name,\n value: BlockVisibilityGeolocation.countries[country].code,\n } );\n \n }\n\n return countries;\n\n}// end getCountries()\n\nfunction ContentVisibilityGeolocationBodyControl( { instanceId, props } ) {\n\n const data = getCountries();\n const type = 'geolocation';\n\n return (\n <PanelBody\n title={ __( 'Geolocation', 'content-visibility-geolocation' ) }\n initialOpen={ false }\n className=\"content-visibility-control-panel content-visibility-geolocation-controls\"\n >\n <PanelRow>\n <ContentVisibilityGeolocationMultiSelect data={ data } labelledBy=\"Select Specific Users\" props={ props } type={ type } />\n </PanelRow>\n\n { props.attributes.contentVisibility && (\n <p className=\"geolocation-help-intro content-visibility-help-text\">{ __( 'Select one or more countries to whom this block will be ' + props.attributes.contentVisibility + '. If no countries are selected, this block will be ' + props.attributes.contentVisibility + ' regardless of a user\\'s location.', 'content-visibility-geolocation' ) }</p>\n ) }\n </PanelBody>\n );\n\n}\n\nexport default withInstanceId( ContentVisibilityGeolocationBodyControl );","import { Fill, Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\nimport ContentVisibilityGeolocationPanelBodyControl from './content-visibility-geolocation-panel-body';\n\nexport function ContentVisibilityGeolocationControl( data ) {\n\n let { props } = { ...data };\n\n let rulesEnabled = props.attributes.contentVisibilityRules.contentVisibilityRulesEnabled;\n let contentVisibility = props.attributes.hasOwnProperty( 'contentVisibility' );\n\n if ( ! rulesEnabled || ! contentVisibility ) {\n return (\n <Disabled><ContentVisibilityGeolocationPanelBodyControl props={ props } /></Disabled>\n );\n }\n\n return (\n <ContentVisibilityGeolocationPanelBodyControl props={ props } />\n );\n\n}\n\n/**\n * Render the <ContentVisibilityGeolocationControl> component by adding\n * it to the block-visibility-extra-controls Fill.\n *\n * @return {Object} A Fill component wrapping the ContentVisibilityGeolocationControl component.\n */\nfunction ContentVisibilityGeolocationFill() {\n return (\n <Fill name=\"content-visibility-extra-controls\">\n {\n ( fillProps ) => {\n return (\n <ContentVisibilityGeolocationControl props={ fillProps } />\n )\n }\n }\n </Fill>\n );\n\n}\n\n// Add our component to the Slot provided by BlockVisibilityControls\nregisterPlugin( 'content-visibility-05-geolocation-fill', { render: ContentVisibilityGeolocationFill } );\n\n\n// Register our visibility rule with the main plugin\naddFilter( 'contentVisibility.defaultContentVisibilityRules', 'content-visibility-geolocation/block-visibility-rules', registerContentVisibilityRule );\n\nfunction registerContentVisibilityRule( defaultRules ) {\n\n defaultRules.geolocation = {};\n\n return defaultRules;\n\n}\n","// extracted by mini-css-extract-plugin","import './editor.scss';\nimport './style.scss';\n\nimport ContentVisibilityGeolocationControl from './controls/content-visibility-geolocation';","(function() { module.exports = this[\"wp\"][\"components\"]; }());","(function() { module.exports = this[\"wp\"][\"compose\"]; }());","(function() { module.exports = this[\"wp\"][\"element\"]; }());","(function() { module.exports = this[\"wp\"][\"hooks\"]; }());","(function() { module.exports = this[\"wp\"][\"i18n\"]; }());","(function() { module.exports = this[\"wp\"][\"plugins\"]; }());","(function() { module.exports = this[\"React\"]; }());"],"sourceRoot":""}1 {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/@babel/runtime/helpers/defineProperty.js","webpack:///./node_modules/goober/dist/goober.esm.js","webpack:///./node_modules/react-multi-select-component/dist/react-multi-select-component.esm.js","webpack:///./src/controls/content-visibility-geolocation-multisitelect.js","webpack:///./src/controls/content-visibility-geolocation-panel-body.js","webpack:///./src/controls/content-visibility-geolocation.js","webpack:///./src/editor.scss","webpack:///./src/helpers/has-rules.js","webpack:///./src/index.js","webpack:///external {\"this\":[\"wp\",\"components\"]}","webpack:///external {\"this\":[\"wp\",\"compose\"]}","webpack:///external {\"this\":[\"wp\",\"element\"]}","webpack:///external {\"this\":[\"wp\",\"hooks\"]}","webpack:///external {\"this\":[\"wp\",\"i18n\"]}","webpack:///external {\"this\":[\"wp\",\"plugins\"]}","webpack:///external {\"this\":\"React\"}"],"names":["ContentVisibilityGeolocationMultiSelect","withState","option","setState","props","data","labelledBy","type","onChange","setAttributes","contentVisibilityRules","attributes","geolocation","checked","onClick","disabled","icon","label","getCountries","countries","BlockVisibilityGeolocation","length","__","value","notes","country","push","flag","name","code","ContentVisibilityGeolocationBodyControl","instanceId","hasRulesClass","hasRules","contentVisibility","withInstanceId","ContentVisibilityGeolocationControl","rulesEnabled","contentVisibilityRulesEnabled","hasOwnProperty","ContentVisibilityGeolocationFill","fillProps","registerPlugin","render","addFilter","registerContentVisibilityRule","defaultRules","applyFilters"],"mappings":";;;;;;;;;;;;;;;;QAAA;QACA;QACA;QACA;QACA;;QAEA;QACA;QACA;QACA,QAAQ,oBAAoB;QAC5B;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA,iBAAiB,4BAA4B;QAC7C;QACA;QACA,kBAAkB,2BAA2B;QAC7C;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;;QAEA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;QAEA;QACA;QACA;QACA;QACA,gBAAgB,uBAAuB;QACvC;;;QAGA;QACA;QACA;QACA;;;;;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA;;AAEA,iC;;;;;;;;;;;;ACfA;AAAA;AAAA;AAAA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,eAAe,cAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA,GAAG,mCAAmC;AACtC;AACA;;;AAGA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,iBAAiB,cAAc;AAC/B;AACA;;AAEA,iBAAiB,cAAc;AAC/B;AACA,GAAG;;;AAGH,kBAAkB,eAAe;AACjC,oBAAoB,eAAe;AACnC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;;AAEA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA,GAAG,GAAG,4CAAK;AACX;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA,mCAAmC,kDAAG;AACtC;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,SAAS,4CAAK;AACd;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA;AACA,GAAG,GAAG,4CAAK;AACX;;AAEA;AACA;AACA;AACA,iCAAiC,kDAAG;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oDAAM;AACtB,EAAE,uDAAS;AACX,kBAAkB;AAClB,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,gCAAgC,kDAAG;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA,SAAS,4CAAK;AACd;AACA,GAAG;AACH;AACA,WAAW,4CAAK;AAChB;AACA,KAAK,EAAE,4CAAK;AACZ;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC,8BAA8B;;AAE/B,yCAAyC,kDAAG;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qCAAqC,kDAAG;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,sDAAQ;AAC1B;AACA;;AAEA,mBAAmB,sDAAQ;AAC3B;AACA;;AAEA,mBAAmB,sDAAQ;AAC3B;AACA;;AAEA,wBAAwB,yDAAW;AACnC;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;;AAEL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,qDAAO;AACxB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP,KAAK,qCAAqC;AAC1C,GAAG;AACH;AACA;;AAEA,SAAS,4CAAK;AACd;AACA;AACA;AACA,GAAG,oBAAoB,4CAAK;AAC5B;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG,GAAG,4CAAK;AACX;AACA;AACA;AACA;AACA;AACA,GAAG,eAAe,4CAAK,uEAAuE,4CAAK;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG,GAAG,4CAAK;AACX;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA,wBAAwB,4CAAK;AAC7B;AACA,GAAG,wCAAwC,4CAAK;AAChD;;AAEA,2BAA2B,kDAAG;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,kCAAkC,kDAAG;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qCAAqC,kDAAG;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,mCAAmC,kDAAG;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,uCAAuC,kDAAG;AAC1C;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,sDAAQ;AAC1B;AACA;;AAEA,mBAAmB,sDAAQ;AAC3B;AACA;;AAEA,mBAAmB,sDAAQ;AAC3B;AACA;;AAEA;AACA,gBAAgB,oDAAM;AACtB;;AAEA,EAAE,uDAAS;AACX;AACA,GAAG;AACH,EAAE,uDAAS;AACX;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,SAAS,4CAAK;AACd;AACA;AACA;AACA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AP;AACH;;AAED,MAAK,CAAEN,KAAK,CAACO,UAAN,CAAiBD,sBAAjB,CAAwCH,IAAxC,CAAP,EAAuD;AACnD,WAAO,KAAP;AACH,GAR6B,CAU9B;;;AACA,MAAI0B,QAAQ,GAAG,KAAf;;AAEA,UAAS1B,IAAT;AAEI,SAAK,aAAL;AAEI,UAAKH,KAAK,CAACO,UAAN,CAAiBD,sBAAjB,CAAwCH,IAAxC,KAAiDH,KAAK,CAACO,UAAN,CAAiBD,sBAAjB,CAAwCH,IAAxC,EAA8CA,IAA9C,CAAjD,IAAwGH,KAAK,CAACO,UAAN,CAAiBD,sBAAjB,CAAwCH,IAAxC,EAA8CA,IAA9C,EAAoDc,MAApD,IAA8D,CAA3K,EAA+K;AAC3KY,gBAAQ,GAAG,IAAX;AACH;;AAED;;AAEJ;AACI;AAXR;;AAcA,SAAOc,qEAAY,CAAE,8BAAF,EAAkCd,QAAlC,EAA4C7B,KAA5C,EAAmDG,IAAnD,CAAnB;AAEH,C,CAAA;;;AAEc0B,uEAAf,E;;;;;;;;;;;;ACzCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;;;;;;;;;;;;ACDA,aAAa,2CAA2C,EAAE,I;;;;;;;;;;;ACA1D,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,sCAAsC,EAAE,I;;;;;;;;;;;ACArD,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,gCAAgC,EAAE,I","file":"index.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"index\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([\"./src/index.js\",\"style-index\"]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","let e={data:\"\"},t=t=>{if(\"undefined\"!=typeof window){let e=t?t.querySelector(\"#_goober\"):window._goober;return e||(e=(t||document.head).appendChild(document.createElement(\"style\")),e.innerHTML=\" \",e.id=\"_goober\"),e.firstChild}return t||e},r=e=>{let r=t(e),l=r.data;return r.data=\"\",l},l=/(?:([A-Z0-9-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(})/gi,a=/\\/\\*[\\s\\S]*?\\*\\/|\\s{2,}|\\n/gm,n=(e,t)=>{let r,l=\"\",a=\"\",o=\"\";for(let c in e){let s=e[c];\"object\"==typeof s?(r=t?t.replace(/([^,])+/g,e=>c.replace(/([^,])+/g,t=>/&/g.test(t)?t.replace(/&/g,e):e?e+\" \"+t:t)):c,a+=\"@\"==c[0]?\"f\"==c[1]?n(s,c):c+\"{\"+n(s,\"k\"==c[1]?\"\":t)+\"}\":n(s,r)):\"@\"==c[0]&&\"i\"==c[1]?l=c+\" \"+s+\";\":o+=n.p?n.p(c.replace(/[A-Z]/g,\"-$&\").toLowerCase(),s):c.replace(/[A-Z]/g,\"-$&\").toLowerCase()+\":\"+s+\";\"}return o[0]?(r=t?t+\"{\"+o+\"}\":o,l+r+a):l+a},o={},c=e=>{let t=\"\";for(let r in e)t+=r+(\"object\"==typeof e[r]?c(e[r]):e[r]);return t},s=(e,t,r,s,i)=>{let p=\"object\"==typeof e?c(e):e,u=o[p]||(o[p]=\"go\"+p.split(\"\").reduce((e,t)=>101*e+t.charCodeAt(0)>>>0,11));if(!o[u]){let t=\"object\"==typeof e?e:(e=>{let t,r=[{}];for(;t=l.exec(e.replace(a,\"\"));)t[4]&&r.shift(),t[3]?r.unshift(r[0][t[3]]=r[0][t[3]]||{}):t[4]||(r[0][t[1]]=t[2]);return r[0]})(e);o[u]=n(i?{[\"@keyframes \"+u]:t}:t,r?\"\":\".\"+u)}return((e,t,r)=>{-1==t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e)})(o[u],t,s),u},i=(e,t,r)=>e.reduce((e,l,a)=>{let o=t[a];if(o&&o.call){let e=o(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?\".\"+t:e&&\"object\"==typeof e?e.props?\"\":n(e,\"\"):e}return e+l+(null==o?\"\":o)},\"\");function p(e){let r=this||{},l=e.call?e(r.p):e;return s(l.unshift?l.raw?i(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>t?Object.assign(e,t.call?t(r.p):t):e,{}):l,t(r.target),r.g,r.o,r.k)}let u,d,f,g=p.bind({g:1}),b=p.bind({k:1});function h(e,t,r,l){n.p=t,u=e,d=r,f=l}function m(e,t){let r=this||{};return function(){let l=arguments;function a(n,o){let c=Object.assign({},n),s=c.className||a.className;r.p=Object.assign({theme:d&&d()},c),r.o=/ *go\\d+/g.test(s),c.className=p.apply(r,l)+(s?\" \"+s:\"\"),t&&(c.ref=o);let i=c.as||e;return f&&i[0]&&f(c),u(i,c)}return t?t(a):a}}export{p as css,r as extractCss,g as glob,b as keyframes,h as setup,m as styled};\n","import { css } from 'goober';\nimport React, { useRef, useEffect, useState, useCallback, useMemo } from 'react';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nvar defaultStrings = {\n selectSomeItems: \"Select...\",\n allItemsAreSelected: \"All items are selected.\",\n selectAll: \"Select All\",\n search: \"Search\",\n clearSearch: \"Clear Search\",\n clearSelected: \"Clear Selected\"\n};\nvar defaultProps = {\n value: [],\n focusSearchOnOpen: true,\n hasSelectAll: true,\n className: \"multi-select\",\n debounceDuration: 300,\n options: []\n};\nvar MultiSelectContext = /*#__PURE__*/React.createContext({});\nvar MultiSelectProvider = function MultiSelectProvider(_ref) {\n var props = _ref.props,\n children = _ref.children;\n\n var t = function t(key) {\n var _props$overrideString;\n\n return ((_props$overrideString = props.overrideStrings) == null ? void 0 : _props$overrideString[key]) || defaultStrings[key];\n };\n\n return React.createElement(MultiSelectContext.Provider, {\n value: _extends({\n t: t\n }, defaultProps, props)\n }, children);\n};\nvar useMultiSelect = function useMultiSelect() {\n return React.useContext(MultiSelectContext);\n};\n\n/**\r\n * combines classNames in a friendly way\r\n *\r\n * @param {*} classes\r\n */\nvar cn = function cn() {\n for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) {\n classes[_key] = arguments[_key];\n }\n\n return classes.join(\" \");\n};\n\nvar debounce = function debounce(func, wait) {\n var timeout;\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n func.apply(null, args);\n }, wait);\n };\n};\n\n/**\r\n * Filters React Select options and sorts by similarity to a search filter.\r\n * Handles partial matches, eg. searching for \"Waberg High\" will find \"Raoul\r\n * Wallenberg Traditional High School\". Case insensitive. Ignores\r\n * non-alphanumeric characters.\r\n *\r\n * @param options An unfiltered list of Options.\r\n * @param? filter A string to compare against Option labels.\r\n * @param? substitutions Strings with multiple spellings or variations that we\r\n * expect to match, eg. accented characters or abbreviated words.\r\n *\r\n * @return A filtered and sorted array of Options.\r\n */\nfunction filterOptions(options, filter, substitutions) {\n // If the filter is blank, return the full list of Options.\n if (!filter) {\n return options;\n }\n\n var cleanFilter = cleanUpText(filter, substitutions);\n return options // Filter out undefined or null Options.\n .filter(function (_ref) {\n var label = _ref.label,\n value = _ref.value;\n return label != null && value != null;\n }) // Create a {score, Option} pair for each Option based on its label's\n // similarity to the filter text.\n .map(function (option) {\n return {\n option: option,\n score: typeaheadSimilarity(cleanUpText(option.label, substitutions), cleanFilter)\n };\n }) // Only include matches of the entire substring, with a slight\n // affordance for transposition or extra characters.\n .filter(function (pair) {\n return pair.score >= cleanFilter.length - 2;\n }) // Sort 'em by order of their score.\n .sort(function (a, b) {\n return b.score - a.score;\n }) // …and grab the original Options back from their pairs.\n .map(function (pair) {\n return pair.option;\n });\n}\n/**\r\n * Scores the similarity between two strings by returning the length of the\r\n * longest common subsequence. Intended for comparing strings of different\r\n * lengths; eg. when matching a typeahead search input with a school name.\r\n\n * Meant for use in an instant search box where results are being fetched\r\n * as a user is typing.\r\n *\r\n * @param a The longer string (though, we flip them if it's shorter).\r\n * @param b The shorter string, eg. a typeahead search input.\r\n *\r\n * @return The length of the longest common subsequence. Higher scores indicate\r\n * closer matches.\r\n */\n\nfunction typeaheadSimilarity(a, b) {\n var aLength = a.length;\n var bLength = b.length;\n var table = [];\n\n if (!aLength || !bLength) {\n return 0;\n } // Ensure `a` isn't shorter than `b`.\n\n\n if (aLength < bLength) {\n var _ref2 = [b, a];\n a = _ref2[0];\n b = _ref2[1];\n } // Early exit if `a` includes `b`; these will be scored higher than any\n // other options with the same `b` (filter string), with a preference for\n // shorter `a` strings (option labels).\n\n\n if (a.indexOf(b) !== -1) {\n return bLength + 1 / aLength;\n } // Initialize the table axes:\n //\n // 0 0 0 0 ... bLength\n // 0\n // 0\n //\n // ...\n //\n // aLength\n //\n\n\n for (var x = 0; x <= aLength; ++x) {\n table[x] = [0];\n }\n\n for (var y = 0; y <= bLength; ++y) {\n table[0][y] = 0;\n } // Populate the rest of the table with a dynamic programming algorithm.\n\n\n for (var _x = 1; _x <= aLength; ++_x) {\n for (var _y = 1; _y <= bLength; ++_y) {\n table[_x][_y] = a[_x - 1] === b[_y - 1] ? 1 + table[_x - 1][_y - 1] : Math.max(table[_x][_y - 1], table[_x - 1][_y]);\n }\n }\n\n return table[aLength][bLength];\n}\n/**\r\n * Apply string substitutions, remove non-alphanumeric characters, and convert\r\n * all letters to uppercase.\r\n *\r\n * eg. 'Scoil Bhríde Primary School' may become 'SCOILBHRIDEPRIMARYSCHOOL'.\r\n *\r\n * @param input An unsanitized input string.\r\n * @param substitutions Strings with multiple spellings or variations that we\r\n * expect to match, for example accented characters or abbreviated\r\n * words.\r\n *\r\n * @return The sanitized text.\r\n */\n\nfunction cleanUpText(input, substitutions) {\n if (!input) {\n return \"\";\n } // Uppercase and remove all non-alphanumeric, non-accented characters.\n // Also remove underscores.\n\n\n input = input.toUpperCase().replace(/((?=[^\\u00E0-\\u00FC])\\W)|_/g, \"\");\n\n if (!substitutions) {\n return input;\n }\n\n var safeSubstitutions = substitutions; // For Flow.\n // Replace all strings in `safeSubstitutions` with their standardized\n // counterparts.\n\n return Object.keys(safeSubstitutions).reduce(function (output, substitution) {\n var unsubbed = new RegExp(substitution, \"g\");\n return output.replace(unsubbed, safeSubstitutions[substitution]);\n }, input);\n}\n\nvar Cross = function Cross() {\n return React.createElement(\"svg\", {\n width: \"24\",\n height: \"24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"2\",\n className: \"dropdown-search-clear-icon gray\"\n }, React.createElement(\"line\", {\n x1: \"18\",\n y1: \"6\",\n x2: \"6\",\n y2: \"18\"\n }), React.createElement(\"line\", {\n x1: \"6\",\n y1: \"6\",\n x2: \"18\",\n y2: \"18\"\n }));\n};\n\nvar DefaultRenderer = /*#__PURE__*/css({\n \"& input,& span\": {\n verticalAlign: \"middle\",\n margin: 0\n },\n span: {\n display: \"inline-block\",\n paddingLeft: \"5px\"\n },\n \"&.disabled\": {\n opacity: 0.5\n }\n});\n\nvar DefaultItemRenderer = function DefaultItemRenderer(_ref) {\n var checked = _ref.checked,\n option = _ref.option,\n onClick = _ref.onClick,\n disabled = _ref.disabled;\n return React.createElement(\"div\", {\n className: cn(DefaultRenderer, \"item-renderer\", disabled && \"disabled\")\n }, React.createElement(\"input\", {\n type: \"checkbox\",\n onChange: onClick,\n checked: checked,\n tabIndex: -1,\n disabled: disabled\n }), React.createElement(\"span\", null, option.label));\n};\n\n/**\r\n * This component represents an individual item in the multi-select drop-down\r\n */\nvar ItemContainer = /*#__PURE__*/css({\n boxSizing: \"border-box\",\n cursor: \"pointer\",\n display: \"block\",\n padding: \"var(--rmsc-p)\",\n outline: 0,\n \"&:hover,&:focus\": {\n background: \"var(--rmsc-hover)\"\n },\n \"&.selected\": {\n background: \"var(--rmsc-selected)\"\n }\n});\n\nvar SelectItem = function SelectItem(_ref) {\n var _ref$itemRenderer = _ref.itemRenderer,\n ItemRenderer = _ref$itemRenderer === void 0 ? DefaultItemRenderer : _ref$itemRenderer,\n option = _ref.option,\n checked = _ref.checked,\n focused = _ref.focused,\n tabIndex = _ref.tabIndex,\n disabled = _ref.disabled,\n onSelectionChanged = _ref.onSelectionChanged,\n onClick = _ref.onClick;\n var itemRef = useRef();\n useEffect(function () {\n updateFocus(); // eslint-disable-next-line\n }, [checked, focused]);\n\n var toggleChecked = function toggleChecked() {\n onSelectionChanged(!checked);\n };\n\n var handleClick = function handleClick(e) {\n toggleChecked();\n onClick(e);\n };\n\n var updateFocus = function updateFocus() {\n if (focused && !disabled && itemRef) {\n itemRef.current.focus();\n }\n };\n\n var handleKeyDown = function handleKeyDown(e) {\n switch (e.which) {\n case 13: // Enter\n\n case 32:\n // Space\n toggleChecked();\n break;\n\n default:\n return;\n }\n\n e.preventDefault();\n };\n\n return React.createElement(\"label\", {\n className: cn(ItemContainer, \"select-item\", checked && \"selected\"),\n role: \"option\",\n \"aria-selected\": checked,\n tabIndex: tabIndex,\n ref: itemRef,\n onKeyDown: handleKeyDown\n }, React.createElement(ItemRenderer, {\n option: option,\n checked: checked,\n onClick: handleClick,\n disabled: disabled\n }));\n};\n\n/**\r\n * This component represents an unadorned list of SelectItem (s).\r\n */\nvar SelectListUl = /*#__PURE__*/css({\n margin: 0,\n paddingLeft: 0,\n li: {\n listStyle: \"none\",\n margin: 0\n }\n});\nvar skipIndex = 2;\n\nvar SelectList = function SelectList(_ref) {\n var options = _ref.options,\n focusIndex = _ref.focusIndex,\n _onClick = _ref.onClick;\n\n var _useMultiSelect = useMultiSelect(),\n disabled = _useMultiSelect.disabled,\n value = _useMultiSelect.value,\n onChange = _useMultiSelect.onChange,\n ItemRenderer = _useMultiSelect.ItemRenderer;\n\n var handleSelectionChanged = function handleSelectionChanged(option, checked) {\n if (disabled) {\n return;\n }\n\n onChange(checked ? [].concat(value, [option]) : value.filter(function (o) {\n return o.value !== option.value;\n }));\n };\n\n return React.createElement(\"ul\", {\n className: SelectListUl\n }, options.map(function (o, i) {\n var tabIndex = i + skipIndex;\n return React.createElement(\"li\", {\n key: (o == null ? void 0 : o.key) || i\n }, React.createElement(SelectItem, {\n focused: focusIndex === tabIndex,\n tabIndex: tabIndex,\n option: o,\n onSelectionChanged: function onSelectionChanged(c) {\n return handleSelectionChanged(o, c);\n },\n checked: value.find(function (s) {\n return s.value === o.value;\n }) ? true : false,\n onClick: function onClick(e) {\n return _onClick(e, tabIndex);\n },\n itemRenderer: ItemRenderer,\n disabled: o.disabled || disabled\n }));\n }));\n};\n\n/**\r\n * This component represents the entire panel which gets dropped down when the\r\n * user selects the component. It encapsulates the search filter, the\r\n * Select-all item, and the list of options.\r\n */\nvar FocusType;\n\n(function (FocusType) {\n FocusType[FocusType[\"SEARCH\"] = -1] = \"SEARCH\";\n FocusType[FocusType[\"NONE\"] = 1] = \"NONE\";\n})(FocusType || (FocusType = {}));\n\nvar SelectSearchContainer = /*#__PURE__*/css({\n width: \"100%\",\n position: \"relative\",\n borderBottom: \"1px solid var(--rmsc-border)\",\n input: {\n height: \"var(--rmsc-h)\",\n padding: \"0 var(--rmsc-p)\",\n width: \"100%\",\n outline: 0,\n border: 0\n }\n});\nvar SearchClearButton = /*#__PURE__*/css({\n cursor: \"pointer\",\n position: \"absolute\",\n top: 0,\n right: 0,\n bottom: 0,\n background: \"none\",\n border: 0,\n padding: \"0 calc(var(--rmsc-p)/2)\",\n \"[hidden]\": {\n display: \"none\"\n }\n});\n\nvar SelectPanel = function SelectPanel() {\n var _useMultiSelect = useMultiSelect(),\n t = _useMultiSelect.t,\n onChange = _useMultiSelect.onChange,\n options = _useMultiSelect.options,\n value = _useMultiSelect.value,\n customFilterOptions = _useMultiSelect.filterOptions,\n selectAllLabel = _useMultiSelect.selectAllLabel,\n ItemRenderer = _useMultiSelect.ItemRenderer,\n disabled = _useMultiSelect.disabled,\n disableSearch = _useMultiSelect.disableSearch,\n focusSearchOnOpen = _useMultiSelect.focusSearchOnOpen,\n hasSelectAll = _useMultiSelect.hasSelectAll,\n ClearIcon = _useMultiSelect.ClearIcon,\n debounceDuration = _useMultiSelect.debounceDuration;\n\n var _useState = useState(\"\"),\n searchText = _useState[0],\n setSearchText = _useState[1];\n\n var _useState2 = useState(\"\"),\n searchTextForFilter = _useState2[0],\n setSearchTextForFilter = _useState2[1];\n\n var _useState3 = useState(focusSearchOnOpen && !disableSearch ? FocusType.SEARCH : FocusType.NONE),\n focusIndex = _useState3[0],\n setFocusIndex = _useState3[1];\n\n var debouncedSearch = useCallback(debounce(function (query) {\n return setSearchTextForFilter(query);\n }, debounceDuration), []);\n var selectAllOption = {\n label: selectAllLabel || t(\"selectAll\"),\n value: \"\"\n };\n\n var selectAllValues = function selectAllValues(checked) {\n var filteredValues = filteredOptions().filter(function (o) {\n return !o.disabled;\n }).map(function (o) {\n return o.value;\n });\n\n if (checked) {\n var selectedValues = value.map(function (o) {\n return o.value;\n });\n var finalSelectedValues = [].concat(selectedValues, filteredValues);\n return options.filter(function (o) {\n return finalSelectedValues.includes(o.value);\n });\n }\n\n return value.filter(function (o) {\n return !filteredValues.includes(o.value);\n });\n };\n\n var selectAllChanged = function selectAllChanged(checked) {\n var newOptions = selectAllValues(checked);\n onChange(newOptions);\n };\n\n var handleSearchChange = function handleSearchChange(e) {\n debouncedSearch(e.target.value);\n setSearchText(e.target.value);\n setFocusIndex(FocusType.SEARCH);\n };\n\n var handleClear = function handleClear() {\n setSearchTextForFilter(\"\");\n setSearchText(\"\");\n };\n\n var handleItemClicked = function handleItemClicked(index) {\n return setFocusIndex(index);\n };\n\n var handleKeyDown = function handleKeyDown(e) {\n switch (e.which) {\n case 38:\n // Up Arrow\n if (e.altKey) {\n return;\n }\n\n updateFocus(-1);\n break;\n\n case 40:\n // Down Arrow\n if (e.altKey) {\n return;\n }\n\n updateFocus(1);\n break;\n\n default:\n return;\n }\n\n e.stopPropagation();\n e.preventDefault();\n };\n\n var handleSearchFocus = function handleSearchFocus() {\n setFocusIndex(FocusType.SEARCH);\n };\n\n var filteredOptions = function filteredOptions() {\n return customFilterOptions ? customFilterOptions(options, searchTextForFilter) : filterOptions(options, searchTextForFilter);\n };\n\n var updateFocus = function updateFocus(offset) {\n var newFocus = focusIndex + offset;\n newFocus = Math.max(1, newFocus);\n newFocus = Math.min(newFocus, options.length + 1);\n setFocusIndex(newFocus);\n };\n\n var _useMemo = useMemo(function () {\n var filteredOptionsList = filteredOptions().filter(function (o) {\n return !o.disabled;\n });\n return [filteredOptionsList.every(function (o) {\n return value.findIndex(function (v) {\n return v.value === o.value;\n }) !== -1;\n }), filteredOptionsList.length !== 0]; // eslint-disable-next-line\n }, [searchText, value]),\n isAllOptionSelected = _useMemo[0],\n hasSelectableOptions = _useMemo[1];\n\n return React.createElement(\"div\", {\n className: \"select-panel\",\n role: \"listbox\",\n onKeyDown: handleKeyDown\n }, !disableSearch && React.createElement(\"div\", {\n className: SelectSearchContainer\n }, React.createElement(\"input\", {\n autoFocus: focusSearchOnOpen,\n placeholder: t(\"search\"),\n type: \"text\",\n \"aria-describedby\": t(\"search\"),\n onKeyDown: function onKeyDown(e) {\n return e.stopPropagation();\n },\n onChange: handleSearchChange,\n onFocus: handleSearchFocus,\n value: searchText\n }), React.createElement(\"button\", {\n type: \"button\",\n className: cn(SearchClearButton, \"search-clear-button\"),\n hidden: !searchText,\n onClick: handleClear,\n \"aria-label\": t(\"clearSearch\")\n }, ClearIcon || React.createElement(Cross, null))), hasSelectAll && hasSelectableOptions && React.createElement(SelectItem, {\n focused: focusIndex === 1,\n tabIndex: 1,\n checked: isAllOptionSelected,\n option: selectAllOption,\n onSelectionChanged: selectAllChanged,\n onClick: function onClick() {\n return handleItemClicked(1);\n },\n itemRenderer: ItemRenderer,\n disabled: disabled\n }), React.createElement(SelectList, {\n options: filteredOptions(),\n focusIndex: focusIndex,\n onClick: function onClick(_e, index) {\n return handleItemClicked(index);\n }\n }));\n};\n\nvar Arrow = function Arrow(_ref) {\n var expanded = _ref.expanded;\n return React.createElement(\"svg\", {\n width: \"24\",\n height: \"24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"2\",\n className: \"dropdown-heading-dropdown-arrow gray\"\n }, React.createElement(\"path\", {\n d: expanded ? \"M18 15 12 9 6 15\" : \"M6 9L12 15 18 9\"\n }));\n};\n\nvar DropdownHeader = function DropdownHeader() {\n var _useMultiSelect = useMultiSelect(),\n t = _useMultiSelect.t,\n value = _useMultiSelect.value,\n options = _useMultiSelect.options,\n valueRenderer = _useMultiSelect.valueRenderer;\n\n var noneSelected = value.length === 0;\n var allSelected = value.length === options.length;\n var customText = valueRenderer && valueRenderer(value, options);\n\n var getSelectedText = function getSelectedText() {\n return value.map(function (s) {\n return s.label;\n }).join(\", \");\n };\n\n return noneSelected ? React.createElement(\"span\", {\n className: \"gray\"\n }, customText || t(\"selectSomeItems\")) : React.createElement(\"span\", null, customText || (allSelected ? t(\"allItemsAreSelected\") : getSelectedText()));\n};\n\nvar Spinner = /*#__PURE__*/css({\n animation: \"rotate 2s linear infinite\",\n \"& .path\": {\n stroke: \"var(--rmsc-border)\",\n strokeWidth: \"4px\",\n strokeLinecap: \"round\",\n animation: \"dash 1.5s ease-in-out infinite\"\n },\n \"@keyframes rotate\": {\n \"100%\": {\n transform: \"rotate(360deg)\"\n }\n },\n \"@keyframes dash\": {\n \"0%\": {\n strokeDasharray: \"1,150\",\n strokeDashoffset: 0\n },\n \"50%\": {\n strokeDasharray: \"90,150\",\n strokeDashoffset: \"-35\"\n },\n \"100%\": {\n strokeDasharray: \"90,150\",\n strokeDashoffset: \"-124\"\n }\n }\n});\nvar Loading = function Loading(_ref) {\n var _ref$size = _ref.size,\n size = _ref$size === void 0 ? 24 : _ref$size;\n return React.createElement(\"span\", {\n style: {\n width: size,\n marginRight: \"0.2rem\"\n }\n }, React.createElement(\"svg\", {\n width: size,\n height: size,\n className: Spinner,\n viewBox: \"0 0 50 50\",\n style: {\n display: \"inline\",\n verticalAlign: \"middle\"\n }\n }, React.createElement(\"circle\", {\n cx: \"25\",\n cy: \"25\",\n r: \"20\",\n fill: \"none\",\n className: \"path\"\n })));\n};\n\n/**\r\n * A generic dropdown component. It takes the children of the component\r\n * and hosts it in the component. When the component is selected, it\r\n * drops-down the contentComponent and applies the contentProps.\r\n */\nvar PanelContainer = /*#__PURE__*/css({\n position: \"absolute\",\n zIndex: 1,\n top: \"100%\",\n width: \"100%\",\n paddingTop: \"8px\",\n \".panel-content\": {\n maxHeight: \"300px\",\n overflowY: \"auto\",\n borderRadius: \"var(--rmsc-radius)\",\n background: \"var(--rmsc-bg)\",\n boxShadow: \"0 0 0 1px rgba(0, 0, 0, 0.1), 0 4px 11px rgba(0, 0, 0, 0.1)\"\n }\n});\nvar DropdownContainer = /*#__PURE__*/css({\n position: \"relative\",\n outline: 0,\n backgroundColor: \"var(--rmsc-bg)\",\n border: \"1px solid var(--rmsc-border)\",\n borderRadius: \"var(--rmsc-radius)\",\n \"&:focus-within\": {\n boxShadow: \"var(--rmsc-main) 0 0 0 1px\",\n borderColor: \"var(--rmsc-main)\"\n }\n});\nvar DropdownHeading = /*#__PURE__*/css({\n position: \"relative\",\n padding: \"0 var(--rmsc-p)\",\n display: \"flex\",\n alignItems: \"center\",\n width: \"100%\",\n height: \"var(--rmsc-h)\",\n cursor: \"default\",\n outline: 0,\n \".dropdown-heading-value\": {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n flex: 1\n }\n});\nvar ClearSelectedButton = /*#__PURE__*/css({\n cursor: \"pointer\",\n background: \"none\",\n border: 0,\n padding: 0,\n display: \"flex\"\n});\n\nvar Dropdown = function Dropdown() {\n var _useMultiSelect = useMultiSelect(),\n t = _useMultiSelect.t,\n onMenuToggle = _useMultiSelect.onMenuToggle,\n ArrowRenderer = _useMultiSelect.ArrowRenderer,\n shouldToggleOnHover = _useMultiSelect.shouldToggleOnHover,\n isLoading = _useMultiSelect.isLoading,\n disabled = _useMultiSelect.disabled,\n onChange = _useMultiSelect.onChange,\n labelledBy = _useMultiSelect.labelledBy,\n value = _useMultiSelect.value,\n isOpen = _useMultiSelect.isOpen,\n defaultIsOpen = _useMultiSelect.defaultIsOpen,\n ClearSelectedIcon = _useMultiSelect.ClearSelectedIcon;\n\n var _useState = useState(true),\n isInternalExpand = _useState[0],\n setIsInternalExpand = _useState[1];\n\n var _useState2 = useState(defaultIsOpen),\n expanded = _useState2[0],\n setExpanded = _useState2[1];\n\n var _useState3 = useState(false),\n hasFocus = _useState3[0],\n setHasFocus = _useState3[1];\n\n var FinalArrow = ArrowRenderer || Arrow;\n var wrapper = useRef();\n /* eslint-disable react-hooks/exhaustive-deps */\n\n useEffect(function () {\n onMenuToggle && onMenuToggle(expanded);\n }, [expanded]);\n useEffect(function () {\n if (defaultIsOpen === undefined && typeof isOpen === \"boolean\") {\n setIsInternalExpand(false);\n setExpanded(isOpen);\n }\n }, [isOpen]);\n\n var handleKeyDown = function handleKeyDown(e) {\n var _wrapper$current;\n\n if (isInternalExpand) {\n switch (e.which) {\n case 27: // Escape\n\n case 38:\n // Up Arrow\n setExpanded(false);\n wrapper == null ? void 0 : (_wrapper$current = wrapper.current) == null ? void 0 : _wrapper$current.focus();\n break;\n\n case 32: // Space\n\n case 13: // Enter Key\n\n case 40:\n // Down Arrow\n setExpanded(true);\n break;\n\n default:\n return;\n }\n }\n\n e.preventDefault();\n };\n\n var handleHover = function handleHover(iexpanded) {\n isInternalExpand && shouldToggleOnHover && setExpanded(iexpanded);\n };\n\n var handleFocus = function handleFocus() {\n return !hasFocus && setHasFocus(true);\n };\n\n var handleBlur = function handleBlur(e) {\n if (!e.currentTarget.contains(e.relatedTarget) && isInternalExpand) {\n setHasFocus(false);\n setExpanded(false);\n }\n };\n\n var handleMouseEnter = function handleMouseEnter() {\n return handleHover(true);\n };\n\n var handleMouseLeave = function handleMouseLeave() {\n return handleHover(false);\n };\n\n var toggleExpanded = function toggleExpanded() {\n isInternalExpand && setExpanded(isLoading || disabled ? false : !expanded);\n };\n\n var handleClearSelected = function handleClearSelected(e) {\n e.stopPropagation();\n onChange([]);\n isInternalExpand && setExpanded(false);\n };\n\n return React.createElement(\"div\", {\n tabIndex: 0,\n className: cn(DropdownContainer, \"dropdown-container\"),\n \"aria-labelledby\": labelledBy,\n \"aria-expanded\": expanded,\n \"aria-readonly\": true,\n \"aria-disabled\": disabled,\n ref: wrapper,\n onKeyDown: handleKeyDown,\n onFocus: handleFocus,\n onBlur: handleBlur,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave\n }, React.createElement(\"div\", {\n className: cn(DropdownHeading, \"dropdown-heading\"),\n onClick: toggleExpanded\n }, React.createElement(\"div\", {\n className: \"dropdown-heading-value\"\n }, React.createElement(DropdownHeader, null)), isLoading && React.createElement(Loading, null), value.length > 0 && React.createElement(\"button\", {\n type: \"button\",\n className: cn(ClearSelectedButton, \"clear-selected-button\"),\n onClick: handleClearSelected,\n disabled: disabled,\n \"aria-label\": t(\"clearSelected\")\n }, ClearSelectedIcon || React.createElement(Cross, null)), React.createElement(FinalArrow, {\n expanded: expanded\n })), expanded && React.createElement(\"div\", {\n className: cn(PanelContainer, \"dropdown-content\")\n }, React.createElement(\"div\", {\n className: \"panel-content\"\n }, React.createElement(SelectPanel, null))));\n};\n\nvar MultiSelectBox = /*#__PURE__*/css({\n \"--rmscMain\": \"#4285f4\",\n \"--rmscHover\": \"#f1f3f5\",\n \"--rmscSelected\": \"#e2e6ea\",\n \"--rmscBorder\": \"#ccc\",\n \"--rmscGray\": \"#aaa\",\n \"--rmscBg\": \"#fff\",\n \"--rmscP\": \"10px\",\n \"--rmscRadius\": \"4px\",\n \"--rmscH\": \"38px\",\n \"*\": {\n boxSizing: \"border-box\",\n transition: \"all 0.2s ease\"\n },\n \".gray\": {\n color: \"var(--rmsc-gray)\"\n }\n});\n\nvar MultiSelect = function MultiSelect(props) {\n return React.createElement(MultiSelectProvider, {\n props: props\n }, React.createElement(\"div\", {\n className: cn(MultiSelectBox, props.className || \"multi-select\")\n }, React.createElement(Dropdown, null)));\n};\n\nexport default MultiSelect;\nexport { Dropdown, SelectItem, SelectPanel };\n//# sourceMappingURL=react-multi-select-component.esm.js.map\n","import MultiSelect from \"react-multi-select-component\";\nimport { withState } from '@wordpress/compose';\n\nexport const ContentVisibilityGeolocationMultiSelect = withState( {\n option: [],\n} )( ( { option, setState, props, data, labelledBy, type } ) => {\n\n /**\n * onChange callback for the ContentVisibilityMultiSelect component. This handles setting the props and state for\n * this instance of the component.\n * \n * @param {array} option current value of what is selected.\n */\n const onChange = ( option ) => {\n\n // Set the state and props.\n setState( { option } );\n\n props.setAttributes( {\n contentVisibilityRules: {\n ...props.attributes.contentVisibilityRules,\n geolocation: {\n ...props.attributes.contentVisibilityRules.geolocation,\n [type]: option\n }\n },\n } );\n\n };\n\n return (\n <div className=\"content-visibility-multi-select\">\n <MultiSelect\n options={ data }\n value={ props.attributes.contentVisibilityRules.geolocation[type] || option }\n onChange={ onChange }\n labelledBy={ labelledBy }\n ItemRenderer={ ( { checked, option, onClick, disabled, } ) => {\n return (\n <div className={`item-renderer content-visibility-multi-select-item ${disabled && \"disabled\"}`}>\n <input type=\"checkbox\" onChange={ onClick } checked={ checked } tabIndex={ -1 } disabled={ disabled } />\n <span>{option.icon || \"\"} {option.label}</span>\n </div>\n );\n } }\n // isOpen={ true }\n />\n </div>\n );\n\n} );","import { PanelBody, PanelRow } from '@wordpress/components';\nimport { withInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\nimport { ContentVisibilityGeolocationMultiSelect } from '../controls/content-visibility-geolocation-multisitelect';\nimport hasRules from '../helpers/has-rules';\n/**\n * PHP sends through a list of all the users on the site. We massage that data to be\n * usable by our Dropdown.\n *\n */\nfunction getCountries() {\n\n const countries = [];\n\n if ( BlockVisibilityGeolocation.countries.length === 0 ) {\n return [ {\n label: __( 'No countries found.', 'content-visibility' ),\n value: 0,\n notes: '',\n } ]\n }\n\n for ( const country in BlockVisibilityGeolocation.countries ) {\n \n countries.push( { \n icon: BlockVisibilityGeolocation.countries[country].flag,\n label: BlockVisibilityGeolocation.countries[country].name,\n value: BlockVisibilityGeolocation.countries[country].code,\n } );\n \n }\n\n return countries;\n\n}// end getCountries()\n\nfunction ContentVisibilityGeolocationBodyControl( { instanceId, props } ) {\n\n const data = getCountries();\n const type = 'geolocation';\n\n let hasRulesClass = ( hasRules( props, type ) ) ? ' has-active-rules' : '';\n\n return (\n <PanelBody\n title={ __( 'Geolocation', 'content-visibility-geolocation' ) }\n initialOpen={ false }\n className={\"content-visibility-control-panel content-visibility-geolocation-controls\" + hasRulesClass}\n >\n <PanelRow>\n <ContentVisibilityGeolocationMultiSelect data={ data } labelledBy=\"Select Specific Users\" props={ props } type={ type } />\n </PanelRow>\n\n { props.attributes.contentVisibility && (\n <p className=\"geolocation-help-intro content-visibility-help-text\">{ __( 'Select one or more countries to whom this block will be ' + props.attributes.contentVisibility + '. If no countries are selected, this block will be ' + props.attributes.contentVisibility + ' regardless of a user\\'s location.', 'content-visibility-geolocation' ) }</p>\n ) }\n </PanelBody>\n );\n\n}\n\nexport default withInstanceId( ContentVisibilityGeolocationBodyControl );","import { Fill, Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\nimport ContentVisibilityGeolocationPanelBodyControl from './content-visibility-geolocation-panel-body';\n\nexport function ContentVisibilityGeolocationControl( data ) {\n\n let { props } = { ...data };\n\n let rulesEnabled = props.attributes.contentVisibilityRules.contentVisibilityRulesEnabled;\n let contentVisibility = props.attributes.hasOwnProperty( 'contentVisibility' );\n\n if ( ! rulesEnabled || ! contentVisibility ) {\n return (\n <Disabled><ContentVisibilityGeolocationPanelBodyControl props={ props } /></Disabled>\n );\n }\n\n return (\n <ContentVisibilityGeolocationPanelBodyControl props={ props } />\n );\n\n}\n\n/**\n * Render the <ContentVisibilityGeolocationControl> component by adding\n * it to the block-visibility-extra-controls Fill.\n *\n * @return {Object} A Fill component wrapping the ContentVisibilityGeolocationControl component.\n */\nfunction ContentVisibilityGeolocationFill() {\n return (\n <Fill name=\"content-visibility-extra-controls\">\n {\n ( fillProps ) => {\n return (\n <ContentVisibilityGeolocationControl props={ fillProps } />\n )\n }\n }\n </Fill>\n );\n\n}\n\n// Add our component to the Slot provided by BlockVisibilityControls\nregisterPlugin( 'content-visibility-05-geolocation-fill', { render: ContentVisibilityGeolocationFill } );\n\n\n// Register our visibility rule with the main plugin\naddFilter( 'contentVisibility.defaultContentVisibilityRules', 'content-visibility-geolocation/block-visibility-rules', registerContentVisibilityRule );\n\nfunction registerContentVisibilityRule( defaultRules ) {\n\n defaultRules.geolocation = {};\n\n return defaultRules;\n\n}\n","// extracted by mini-css-extract-plugin","import { applyFilters } from '@wordpress/hooks';\n\n/**\n * Determine if the passed block props contain rules of the passed type.\n *\n * @param {object} props The currently selected block's props.\n * @param {string} type The type of the rules i.e. userAuthenticated or specialPage (or ones from add-ons).\n *\n * @return {bool} true if the passed props contain non-empty rules of the passed type. False otherwise.\n */\n function hasRules( props, type ) {\n\n if ( ! props.attributes.contentVisibilityRules ) {\n return false;\n }\n\n if ( ! props.attributes.contentVisibilityRules[type] ) {\n return false;\n }\n\n // Default to false. Passed through a filter later.\n let hasRules = false;\n\n switch ( type ) {\n \n case 'geolocation':\n\n if ( props.attributes.contentVisibilityRules[type] && props.attributes.contentVisibilityRules[type][type] && props.attributes.contentVisibilityRules[type][type].length >= 1 ) {\n hasRules = true;\n }\n\n break;\n\n default:\n break;\n }\n\n return applyFilters( 'content-visibility-has-rules', hasRules, props, type );\n\n}// end hasRules()\n\nexport default hasRules;","import './editor.scss';\nimport './style.scss';\n\nimport ContentVisibilityGeolocationControl from './controls/content-visibility-geolocation';","(function() { module.exports = this[\"wp\"][\"components\"]; }());","(function() { module.exports = this[\"wp\"][\"compose\"]; }());","(function() { module.exports = this[\"wp\"][\"element\"]; }());","(function() { module.exports = this[\"wp\"][\"hooks\"]; }());","(function() { module.exports = this[\"wp\"][\"i18n\"]; }());","(function() { module.exports = this[\"wp\"][\"plugins\"]; }());","(function() { module.exports = this[\"React\"]; }());"],"sourceRoot":""} -
content-visibility-geolocation/tags/0.1.1/content-visibility-geolocation.php
r2510965 r2568524 12 12 * Plugin URI: https://richardtape.com/content-visibility/ 13 13 * Description: [Content Visibility Add-On] Show or hide your blocks to visitors from specific countries. 14 * Version: 0.1. 014 * Version: 0.1.1 15 15 * Author: Richard Tape 16 16 * Author URI: https://richardtape.com -
content-visibility-geolocation/tags/0.1.1/readme.txt
r2510965 r2568524 2 2 Contributors: iamfriendly 3 3 Donate link: https://girlswhocode.com/ 4 Tags: block, content, visibility, geolocation, location, contentvisibility4 Tags: contentvisibility, block, content, visibility, geolocation, location 5 5 Requires at least: 5.0 6 Tested up to: 5. 7.07 Stable tag: 0.1. 06 Tested up to: 5.8.0 7 Stable tag: 0.1.1 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 51 51 == Changelog == 52 52 53 = 0.1.1 = 54 * Added indicator to show when a country is selected to more easily determine when a block has rules. 55 * WP 5.8.0 compatibility. 56 53 57 = 0.1.0 = 54 58 * First public release. -
content-visibility-geolocation/trunk/build/index.asset.php
r2510965 r2568524 1 <?php return array('dependencies' => array('react', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => ' 59bda2f99907d79481792ac67e04a6ba');1 <?php return array('dependencies' => array('react', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => '0ac2c687c8251817d4bcab3af2732814'); -
content-visibility-geolocation/trunk/build/index.js
r2510965 r2568524 1281 1281 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); 1282 1282 /* harmony import */ var _controls_content_visibility_geolocation_multisitelect__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../controls/content-visibility-geolocation-multisitelect */ "./src/controls/content-visibility-geolocation-multisitelect.js"); 1283 /* harmony import */ var _helpers_has_rules__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/has-rules */ "./src/helpers/has-rules.js"); 1284 1283 1285 1284 1286 … … 1320 1322 var data = getCountries(); 1321 1323 var type = 'geolocation'; 1324 var hasRulesClass = Object(_helpers_has_rules__WEBPACK_IMPORTED_MODULE_5__["default"])(props, type) ? ' has-active-rules' : ''; 1322 1325 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["PanelBody"], { 1323 1326 title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Geolocation', 'content-visibility-geolocation'), 1324 1327 initialOpen: false, 1325 className: "content-visibility-control-panel content-visibility-geolocation-controls" 1328 className: "content-visibility-control-panel content-visibility-geolocation-controls" + hasRulesClass 1326 1329 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["PanelRow"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_controls_content_visibility_geolocation_multisitelect__WEBPACK_IMPORTED_MODULE_4__["ContentVisibilityGeolocationMultiSelect"], { 1327 1330 data: data, … … 1432 1435 /***/ }), 1433 1436 1437 /***/ "./src/helpers/has-rules.js": 1438 /*!**********************************!*\ 1439 !*** ./src/helpers/has-rules.js ***! 1440 \**********************************/ 1441 /*! exports provided: default */ 1442 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1443 1444 "use strict"; 1445 __webpack_require__.r(__webpack_exports__); 1446 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); 1447 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__); 1448 1449 /** 1450 * Determine if the passed block props contain rules of the passed type. 1451 * 1452 * @param {object} props The currently selected block's props. 1453 * @param {string} type The type of the rules i.e. userAuthenticated or specialPage (or ones from add-ons). 1454 * 1455 * @return {bool} true if the passed props contain non-empty rules of the passed type. False otherwise. 1456 */ 1457 1458 function hasRules(props, type) { 1459 if (!props.attributes.contentVisibilityRules) { 1460 return false; 1461 } 1462 1463 if (!props.attributes.contentVisibilityRules[type]) { 1464 return false; 1465 } // Default to false. Passed through a filter later. 1466 1467 1468 var hasRules = false; 1469 1470 switch (type) { 1471 case 'geolocation': 1472 if (props.attributes.contentVisibilityRules[type] && props.attributes.contentVisibilityRules[type][type] && props.attributes.contentVisibilityRules[type][type].length >= 1) { 1473 hasRules = true; 1474 } 1475 1476 break; 1477 1478 default: 1479 break; 1480 } 1481 1482 return Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__["applyFilters"])('content-visibility-has-rules', hasRules, props, type); 1483 } // end hasRules() 1484 1485 1486 /* harmony default export */ __webpack_exports__["default"] = (hasRules); 1487 1488 /***/ }), 1489 1434 1490 /***/ "./src/index.js": 1435 1491 /*!**********************!*\ -
content-visibility-geolocation/trunk/build/index.js.map
r2510965 r2568524 1 {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/@babel/runtime/helpers/defineProperty.js","webpack:///./node_modules/goober/dist/goober.esm.js","webpack:///./node_modules/react-multi-select-component/dist/react-multi-select-component.esm.js","webpack:///./src/controls/content-visibility-geolocation-multisitelect.js","webpack:///./src/controls/content-visibility-geolocation-panel-body.js","webpack:///./src/controls/content-visibility-geolocation.js","webpack:///./src/editor.scss","webpack:///./src/ index.js","webpack:///external {\"this\":[\"wp\",\"components\"]}","webpack:///external {\"this\":[\"wp\",\"compose\"]}","webpack:///external {\"this\":[\"wp\",\"element\"]}","webpack:///external {\"this\":[\"wp\",\"hooks\"]}","webpack:///external {\"this\":[\"wp\",\"i18n\"]}","webpack:///external {\"this\":[\"wp\",\"plugins\"]}","webpack:///external {\"this\":\"React\"}"],"names":["ContentVisibilityGeolocationMultiSelect","withState","option","setState","props","data","labelledBy","type","onChange","setAttributes","contentVisibilityRules","attributes","geolocation","checked","onClick","disabled","icon","label","getCountries","countries","BlockVisibilityGeolocation","length","__","value","notes","country","push","flag","name","code","ContentVisibilityGeolocationBodyControl","instanceId","contentVisibility","withInstanceId","ContentVisibilityGeolocationControl","rulesEnabled","contentVisibilityRulesEnabled","hasOwnProperty","ContentVisibilityGeolocationFill","fillProps","registerPlugin","render","addFilter","registerContentVisibilityRule","defaultRules"],"mappings":";;;;;;;;;;;;;;;;QAAA;QACA;QACA;QACA;QACA;;QAEA;QACA;QACA;QAC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ACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA,GAAG,mCAAmC;AACtC;AACA;;;AAGA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,iBAAiB,cAAc;AAC/B;AACA;;AAEA,iBAAiB,cAAc;AAC/B;AACA,GAAG;;;AAGH,kBAAkB,eAAe;AACjC,oBAAoB,eAAe;AACnC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;;AAEA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA,GAAG,GAAG,4CAAK;AACX;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA,mCAAmC,kDAAG;AACtC;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,SAAS,4CAAK;AACd;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA;AACA,GAAG,GAAG,4CAAK;AACX;;AAEA;AACA;AACA;AACA,iCAAiC,kDAAG;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oDAAM;AACtB,EAAE,uDAAS;AACX,kBAAkB;AAClB,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,gCAAgC,kDAAG;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA,SAAS,4CAAK;AACd;AACA,GAAG;AACH;AACA,WAAW,4CAAK;AAChB;AACA,KAAK,EAAE,4CAAK;AACZ;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC,8BAA8B;;AAE/B,yCAAyC,kDAAG;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qCAAqC,kDAAG;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,sDAAQ;AAC1B;AACA;;AAEA,mBAAmB,sDAAQ;AAC3B;AACA;;AAEA,mBAAmB,sDAAQ;AAC3B;AACA;;AAEA,wBAAwB,yDAAW;AACnC;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;;AAEL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,qDAAO;AACxB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP,KAAK,qCAAqC;AAC1C,GAAG;AACH;AACA;;AAEA,SAAS,4CAAK;AACd;AACA;AACA;AACA,GAAG,oBAAoB,4CAAK;AAC5B;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG,GAAG,4CAAK;AACX;AACA;AACA;AACA;AACA;AACA,GAAG,eAAe,4CAAK,uEAAuE,4CAAK;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG,GAAG,4CAAK;AACX;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA,wBAAwB,4CAAK;AAC7B;AACA,GAAG,wCAAwC,4CAAK;AAChD;;AAEA,2BAA2B,kDAAG;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,kCAAkC,kDAAG;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qCAAqC,kDAAG;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,mCAAmC,kDAAG;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,uCAAuC,kDAAG;AAC1C;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,sDAAQ;AAC1B;AACA;;AAEA,mBAAmB,sDAAQ;AAC3B;AACA;;AAEA,mBAAmB,sDAAQ;AAC3B;AACA;;AAEA;AACA,gBAAgB,oDAAM;AACtB;;AAEA,EAAE,uDAAS;AACX;AACA,GAAG;AACH,EAAE,uDAAS;AACX;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA,GAAG,EAAE,4CAAK,oDAAoD,4CAAK,mDAAmD,4CAAK;AAC3H;AACA;AACA;AACA;AACA;AACA,GAAG,uBAAuB,4CAAK,8BAA8B,4CAAK;AAClE;AACA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C;AACzC,WACI,yEAAC,8DAAD,QAAU,yEAAC,kFAAD;AAA8C,WAAK,EAAG5B;AAAtD,MAAV,CADJ;AAGH;;AAED,SACI,yEAAC,kFAAD;AAA8C,SAAK,EAAGA;AAAtD,IADJ;AAIH;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,SAASkC,gCAAT,GAA4C;AACxC,SACI,yEAAC,0DAAD;AAAM,QAAI,EAAC;AAAX,KAEQ,UAAEC,SAAF,EAAiB;AACb,WACI,yEAAC,mCAAD;AAAqC,WAAK,EAAGA;AAA7C,MADJ;AAGH,GANT,CADJ;AAYH,C,CAED;;;AACAC,yEAAc,CAAE,wCAAF,EAA4C;AAAEC,QAAM,EAAEH;AAAV,CAA5C,CAAd,C,CAGA;;AACAI,kEAAS,CAAE,iDAAF,EAAqD,uDAArD,EAA8GC,6BAA9G,CAAT;;AAEA,SAASA,6BAAT,CAAwCC,YAAxC,EAAuD;AAEnDA,cAAY,CAAChC,WAAb,GAA2B,EAA3B;AAEA,SAAOgC,YAAP;AAEH,C;;;;;;;;;;;AC5DD,uC;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;;;;;;;;;;;;ACDA,aAAa,2CAA2C,EAAE,I;;;;;;;;;;;ACA1D,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,sCAAsC,EAAE,I;;;;;;;;;;;ACArD,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,gCAAgC,EAAE,I","file":"index.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"index\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([\"./src/index.js\",\"style-index\"]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","let e={data:\"\"},t=t=>{if(\"undefined\"!=typeof window){let e=t?t.querySelector(\"#_goober\"):window._goober;return e||(e=(t||document.head).appendChild(document.createElement(\"style\")),e.innerHTML=\" \",e.id=\"_goober\"),e.firstChild}return t||e},r=e=>{let r=t(e),l=r.data;return r.data=\"\",l},l=/(?:([A-Z0-9-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(})/gi,a=/\\/\\*[\\s\\S]*?\\*\\/|\\s{2,}|\\n/gm,n=(e,t)=>{let r,l=\"\",a=\"\",o=\"\";for(let c in e){let s=e[c];\"object\"==typeof s?(r=t?t.replace(/([^,])+/g,e=>c.replace(/([^,])+/g,t=>/&/g.test(t)?t.replace(/&/g,e):e?e+\" \"+t:t)):c,a+=\"@\"==c[0]?\"f\"==c[1]?n(s,c):c+\"{\"+n(s,\"k\"==c[1]?\"\":t)+\"}\":n(s,r)):\"@\"==c[0]&&\"i\"==c[1]?l=c+\" \"+s+\";\":o+=n.p?n.p(c.replace(/[A-Z]/g,\"-$&\").toLowerCase(),s):c.replace(/[A-Z]/g,\"-$&\").toLowerCase()+\":\"+s+\";\"}return o[0]?(r=t?t+\"{\"+o+\"}\":o,l+r+a):l+a},o={},c=e=>{let t=\"\";for(let r in e)t+=r+(\"object\"==typeof e[r]?c(e[r]):e[r]);return t},s=(e,t,r,s,i)=>{let p=\"object\"==typeof e?c(e):e,u=o[p]||(o[p]=\"go\"+p.split(\"\").reduce((e,t)=>101*e+t.charCodeAt(0)>>>0,11));if(!o[u]){let t=\"object\"==typeof e?e:(e=>{let t,r=[{}];for(;t=l.exec(e.replace(a,\"\"));)t[4]&&r.shift(),t[3]?r.unshift(r[0][t[3]]=r[0][t[3]]||{}):t[4]||(r[0][t[1]]=t[2]);return r[0]})(e);o[u]=n(i?{[\"@keyframes \"+u]:t}:t,r?\"\":\".\"+u)}return((e,t,r)=>{-1==t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e)})(o[u],t,s),u},i=(e,t,r)=>e.reduce((e,l,a)=>{let o=t[a];if(o&&o.call){let e=o(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?\".\"+t:e&&\"object\"==typeof e?e.props?\"\":n(e,\"\"):e}return e+l+(null==o?\"\":o)},\"\");function p(e){let r=this||{},l=e.call?e(r.p):e;return s(l.unshift?l.raw?i(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>t?Object.assign(e,t.call?t(r.p):t):e,{}):l,t(r.target),r.g,r.o,r.k)}let u,d,f,g=p.bind({g:1}),b=p.bind({k:1});function h(e,t,r,l){n.p=t,u=e,d=r,f=l}function m(e,t){let r=this||{};return function(){let l=arguments;function a(n,o){let c=Object.assign({},n),s=c.className||a.className;r.p=Object.assign({theme:d&&d()},c),r.o=/ *go\\d+/g.test(s),c.className=p.apply(r,l)+(s?\" \"+s:\"\"),t&&(c.ref=o);let i=c.as||e;return f&&i[0]&&f(c),u(i,c)}return t?t(a):a}}export{p as css,r as extractCss,g as glob,b as keyframes,h as setup,m as styled};\n","import { css } from 'goober';\nimport React, { useRef, useEffect, useState, useCallback, useMemo } from 'react';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nvar defaultStrings = {\n selectSomeItems: \"Select...\",\n allItemsAreSelected: \"All items are selected.\",\n selectAll: \"Select All\",\n search: \"Search\",\n clearSearch: \"Clear Search\",\n clearSelected: \"Clear Selected\"\n};\nvar defaultProps = {\n value: [],\n focusSearchOnOpen: true,\n hasSelectAll: true,\n className: \"multi-select\",\n debounceDuration: 300,\n options: []\n};\nvar MultiSelectContext = /*#__PURE__*/React.createContext({});\nvar MultiSelectProvider = function MultiSelectProvider(_ref) {\n var props = _ref.props,\n children = _ref.children;\n\n var t = function t(key) {\n var _props$overrideString;\n\n return ((_props$overrideString = props.overrideStrings) == null ? void 0 : _props$overrideString[key]) || defaultStrings[key];\n };\n\n return React.createElement(MultiSelectContext.Provider, {\n value: _extends({\n t: t\n }, defaultProps, props)\n }, children);\n};\nvar useMultiSelect = function useMultiSelect() {\n return React.useContext(MultiSelectContext);\n};\n\n/**\r\n * combines classNames in a friendly way\r\n *\r\n * @param {*} classes\r\n */\nvar cn = function cn() {\n for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) {\n classes[_key] = arguments[_key];\n }\n\n return classes.join(\" \");\n};\n\nvar debounce = function debounce(func, wait) {\n var timeout;\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n func.apply(null, args);\n }, wait);\n };\n};\n\n/**\r\n * Filters React Select options and sorts by similarity to a search filter.\r\n * Handles partial matches, eg. searching for \"Waberg High\" will find \"Raoul\r\n * Wallenberg Traditional High School\". Case insensitive. Ignores\r\n * non-alphanumeric characters.\r\n *\r\n * @param options An unfiltered list of Options.\r\n * @param? filter A string to compare against Option labels.\r\n * @param? substitutions Strings with multiple spellings or variations that we\r\n * expect to match, eg. accented characters or abbreviated words.\r\n *\r\n * @return A filtered and sorted array of Options.\r\n */\nfunction filterOptions(options, filter, substitutions) {\n // If the filter is blank, return the full list of Options.\n if (!filter) {\n return options;\n }\n\n var cleanFilter = cleanUpText(filter, substitutions);\n return options // Filter out undefined or null Options.\n .filter(function (_ref) {\n var label = _ref.label,\n value = _ref.value;\n return label != null && value != null;\n }) // Create a {score, Option} pair for each Option based on its label's\n // similarity to the filter text.\n .map(function (option) {\n return {\n option: option,\n score: typeaheadSimilarity(cleanUpText(option.label, substitutions), cleanFilter)\n };\n }) // Only include matches of the entire substring, with a slight\n // affordance for transposition or extra characters.\n .filter(function (pair) {\n return pair.score >= cleanFilter.length - 2;\n }) // Sort 'em by order of their score.\n .sort(function (a, b) {\n return b.score - a.score;\n }) // …and grab the original Options back from their pairs.\n .map(function (pair) {\n return pair.option;\n });\n}\n/**\r\n * Scores the similarity between two strings by returning the length of the\r\n * longest common subsequence. Intended for comparing strings of different\r\n * lengths; eg. when matching a typeahead search input with a school name.\r\n\n * Meant for use in an instant search box where results are being fetched\r\n * as a user is typing.\r\n *\r\n * @param a The longer string (though, we flip them if it's shorter).\r\n * @param b The shorter string, eg. a typeahead search input.\r\n *\r\n * @return The length of the longest common subsequence. Higher scores indicate\r\n * closer matches.\r\n */\n\nfunction typeaheadSimilarity(a, b) {\n var aLength = a.length;\n var bLength = b.length;\n var table = [];\n\n if (!aLength || !bLength) {\n return 0;\n } // Ensure `a` isn't shorter than `b`.\n\n\n if (aLength < bLength) {\n var _ref2 = [b, a];\n a = _ref2[0];\n b = _ref2[1];\n } // Early exit if `a` includes `b`; these will be scored higher than any\n // other options with the same `b` (filter string), with a preference for\n // shorter `a` strings (option labels).\n\n\n if (a.indexOf(b) !== -1) {\n return bLength + 1 / aLength;\n } // Initialize the table axes:\n //\n // 0 0 0 0 ... bLength\n // 0\n // 0\n //\n // ...\n //\n // aLength\n //\n\n\n for (var x = 0; x <= aLength; ++x) {\n table[x] = [0];\n }\n\n for (var y = 0; y <= bLength; ++y) {\n table[0][y] = 0;\n } // Populate the rest of the table with a dynamic programming algorithm.\n\n\n for (var _x = 1; _x <= aLength; ++_x) {\n for (var _y = 1; _y <= bLength; ++_y) {\n table[_x][_y] = a[_x - 1] === b[_y - 1] ? 1 + table[_x - 1][_y - 1] : Math.max(table[_x][_y - 1], table[_x - 1][_y]);\n }\n }\n\n return table[aLength][bLength];\n}\n/**\r\n * Apply string substitutions, remove non-alphanumeric characters, and convert\r\n * all letters to uppercase.\r\n *\r\n * eg. 'Scoil Bhríde Primary School' may become 'SCOILBHRIDEPRIMARYSCHOOL'.\r\n *\r\n * @param input An unsanitized input string.\r\n * @param substitutions Strings with multiple spellings or variations that we\r\n * expect to match, for example accented characters or abbreviated\r\n * words.\r\n *\r\n * @return The sanitized text.\r\n */\n\nfunction cleanUpText(input, substitutions) {\n if (!input) {\n return \"\";\n } // Uppercase and remove all non-alphanumeric, non-accented characters.\n // Also remove underscores.\n\n\n input = input.toUpperCase().replace(/((?=[^\\u00E0-\\u00FC])\\W)|_/g, \"\");\n\n if (!substitutions) {\n return input;\n }\n\n var safeSubstitutions = substitutions; // For Flow.\n // Replace all strings in `safeSubstitutions` with their standardized\n // counterparts.\n\n return Object.keys(safeSubstitutions).reduce(function (output, substitution) {\n var unsubbed = new RegExp(substitution, \"g\");\n return output.replace(unsubbed, safeSubstitutions[substitution]);\n }, input);\n}\n\nvar Cross = function Cross() {\n return React.createElement(\"svg\", {\n width: \"24\",\n height: \"24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"2\",\n className: \"dropdown-search-clear-icon gray\"\n }, React.createElement(\"line\", {\n x1: \"18\",\n y1: \"6\",\n x2: \"6\",\n y2: \"18\"\n }), React.createElement(\"line\", {\n x1: \"6\",\n y1: \"6\",\n x2: \"18\",\n y2: \"18\"\n }));\n};\n\nvar DefaultRenderer = /*#__PURE__*/css({\n \"& input,& span\": {\n verticalAlign: \"middle\",\n margin: 0\n },\n span: {\n display: \"inline-block\",\n paddingLeft: \"5px\"\n },\n \"&.disabled\": {\n opacity: 0.5\n }\n});\n\nvar DefaultItemRenderer = function DefaultItemRenderer(_ref) {\n var checked = _ref.checked,\n option = _ref.option,\n onClick = _ref.onClick,\n disabled = _ref.disabled;\n return React.createElement(\"div\", {\n className: cn(DefaultRenderer, \"item-renderer\", disabled && \"disabled\")\n }, React.createElement(\"input\", {\n type: \"checkbox\",\n onChange: onClick,\n checked: checked,\n tabIndex: -1,\n disabled: disabled\n }), React.createElement(\"span\", null, option.label));\n};\n\n/**\r\n * This component represents an individual item in the multi-select drop-down\r\n */\nvar ItemContainer = /*#__PURE__*/css({\n boxSizing: \"border-box\",\n cursor: \"pointer\",\n display: \"block\",\n padding: \"var(--rmsc-p)\",\n outline: 0,\n \"&:hover,&:focus\": {\n background: \"var(--rmsc-hover)\"\n },\n \"&.selected\": {\n background: \"var(--rmsc-selected)\"\n }\n});\n\nvar SelectItem = function SelectItem(_ref) {\n var _ref$itemRenderer = _ref.itemRenderer,\n ItemRenderer = _ref$itemRenderer === void 0 ? DefaultItemRenderer : _ref$itemRenderer,\n option = _ref.option,\n checked = _ref.checked,\n focused = _ref.focused,\n tabIndex = _ref.tabIndex,\n disabled = _ref.disabled,\n onSelectionChanged = _ref.onSelectionChanged,\n onClick = _ref.onClick;\n var itemRef = useRef();\n useEffect(function () {\n updateFocus(); // eslint-disable-next-line\n }, [checked, focused]);\n\n var toggleChecked = function toggleChecked() {\n onSelectionChanged(!checked);\n };\n\n var handleClick = function handleClick(e) {\n toggleChecked();\n onClick(e);\n };\n\n var updateFocus = function updateFocus() {\n if (focused && !disabled && itemRef) {\n itemRef.current.focus();\n }\n };\n\n var handleKeyDown = function handleKeyDown(e) {\n switch (e.which) {\n case 13: // Enter\n\n case 32:\n // Space\n toggleChecked();\n break;\n\n default:\n return;\n }\n\n e.preventDefault();\n };\n\n return React.createElement(\"label\", {\n className: cn(ItemContainer, \"select-item\", checked && \"selected\"),\n role: \"option\",\n \"aria-selected\": checked,\n tabIndex: tabIndex,\n ref: itemRef,\n onKeyDown: handleKeyDown\n }, React.createElement(ItemRenderer, {\n option: option,\n checked: checked,\n onClick: handleClick,\n disabled: disabled\n }));\n};\n\n/**\r\n * This component represents an unadorned list of SelectItem (s).\r\n */\nvar SelectListUl = /*#__PURE__*/css({\n margin: 0,\n paddingLeft: 0,\n li: {\n listStyle: \"none\",\n margin: 0\n }\n});\nvar skipIndex = 2;\n\nvar SelectList = function SelectList(_ref) {\n var options = _ref.options,\n focusIndex = _ref.focusIndex,\n _onClick = _ref.onClick;\n\n var _useMultiSelect = useMultiSelect(),\n disabled = _useMultiSelect.disabled,\n value = _useMultiSelect.value,\n onChange = _useMultiSelect.onChange,\n ItemRenderer = _useMultiSelect.ItemRenderer;\n\n var handleSelectionChanged = function handleSelectionChanged(option, checked) {\n if (disabled) {\n return;\n }\n\n onChange(checked ? [].concat(value, [option]) : value.filter(function (o) {\n return o.value !== option.value;\n }));\n };\n\n return React.createElement(\"ul\", {\n className: SelectListUl\n }, options.map(function (o, i) {\n var tabIndex = i + skipIndex;\n return React.createElement(\"li\", {\n key: (o == null ? void 0 : o.key) || i\n }, React.createElement(SelectItem, {\n focused: focusIndex === tabIndex,\n tabIndex: tabIndex,\n option: o,\n onSelectionChanged: function onSelectionChanged(c) {\n return handleSelectionChanged(o, c);\n },\n checked: value.find(function (s) {\n return s.value === o.value;\n }) ? true : false,\n onClick: function onClick(e) {\n return _onClick(e, tabIndex);\n },\n itemRenderer: ItemRenderer,\n disabled: o.disabled || disabled\n }));\n }));\n};\n\n/**\r\n * This component represents the entire panel which gets dropped down when the\r\n * user selects the component. It encapsulates the search filter, the\r\n * Select-all item, and the list of options.\r\n */\nvar FocusType;\n\n(function (FocusType) {\n FocusType[FocusType[\"SEARCH\"] = -1] = \"SEARCH\";\n FocusType[FocusType[\"NONE\"] = 1] = \"NONE\";\n})(FocusType || (FocusType = {}));\n\nvar SelectSearchContainer = /*#__PURE__*/css({\n width: \"100%\",\n position: \"relative\",\n borderBottom: \"1px solid var(--rmsc-border)\",\n input: {\n height: \"var(--rmsc-h)\",\n padding: \"0 var(--rmsc-p)\",\n width: \"100%\",\n outline: 0,\n border: 0\n }\n});\nvar SearchClearButton = /*#__PURE__*/css({\n cursor: \"pointer\",\n position: \"absolute\",\n top: 0,\n right: 0,\n bottom: 0,\n background: \"none\",\n border: 0,\n padding: \"0 calc(var(--rmsc-p)/2)\",\n \"[hidden]\": {\n display: \"none\"\n }\n});\n\nvar SelectPanel = function SelectPanel() {\n var _useMultiSelect = useMultiSelect(),\n t = _useMultiSelect.t,\n onChange = _useMultiSelect.onChange,\n options = _useMultiSelect.options,\n value = _useMultiSelect.value,\n customFilterOptions = _useMultiSelect.filterOptions,\n selectAllLabel = _useMultiSelect.selectAllLabel,\n ItemRenderer = _useMultiSelect.ItemRenderer,\n disabled = _useMultiSelect.disabled,\n disableSearch = _useMultiSelect.disableSearch,\n focusSearchOnOpen = _useMultiSelect.focusSearchOnOpen,\n hasSelectAll = _useMultiSelect.hasSelectAll,\n ClearIcon = _useMultiSelect.ClearIcon,\n debounceDuration = _useMultiSelect.debounceDuration;\n\n var _useState = useState(\"\"),\n searchText = _useState[0],\n setSearchText = _useState[1];\n\n var _useState2 = useState(\"\"),\n searchTextForFilter = _useState2[0],\n setSearchTextForFilter = _useState2[1];\n\n var _useState3 = useState(focusSearchOnOpen && !disableSearch ? FocusType.SEARCH : FocusType.NONE),\n focusIndex = _useState3[0],\n setFocusIndex = _useState3[1];\n\n var debouncedSearch = useCallback(debounce(function (query) {\n return setSearchTextForFilter(query);\n }, debounceDuration), []);\n var selectAllOption = {\n label: selectAllLabel || t(\"selectAll\"),\n value: \"\"\n };\n\n var selectAllValues = function selectAllValues(checked) {\n var filteredValues = filteredOptions().filter(function (o) {\n return !o.disabled;\n }).map(function (o) {\n return o.value;\n });\n\n if (checked) {\n var selectedValues = value.map(function (o) {\n return o.value;\n });\n var finalSelectedValues = [].concat(selectedValues, filteredValues);\n return options.filter(function (o) {\n return finalSelectedValues.includes(o.value);\n });\n }\n\n return value.filter(function (o) {\n return !filteredValues.includes(o.value);\n });\n };\n\n var selectAllChanged = function selectAllChanged(checked) {\n var newOptions = selectAllValues(checked);\n onChange(newOptions);\n };\n\n var handleSearchChange = function handleSearchChange(e) {\n debouncedSearch(e.target.value);\n setSearchText(e.target.value);\n setFocusIndex(FocusType.SEARCH);\n };\n\n var handleClear = function handleClear() {\n setSearchTextForFilter(\"\");\n setSearchText(\"\");\n };\n\n var handleItemClicked = function handleItemClicked(index) {\n return setFocusIndex(index);\n };\n\n var handleKeyDown = function handleKeyDown(e) {\n switch (e.which) {\n case 38:\n // Up Arrow\n if (e.altKey) {\n return;\n }\n\n updateFocus(-1);\n break;\n\n case 40:\n // Down Arrow\n if (e.altKey) {\n return;\n }\n\n updateFocus(1);\n break;\n\n default:\n return;\n }\n\n e.stopPropagation();\n e.preventDefault();\n };\n\n var handleSearchFocus = function handleSearchFocus() {\n setFocusIndex(FocusType.SEARCH);\n };\n\n var filteredOptions = function filteredOptions() {\n return customFilterOptions ? customFilterOptions(options, searchTextForFilter) : filterOptions(options, searchTextForFilter);\n };\n\n var updateFocus = function updateFocus(offset) {\n var newFocus = focusIndex + offset;\n newFocus = Math.max(1, newFocus);\n newFocus = Math.min(newFocus, options.length + 1);\n setFocusIndex(newFocus);\n };\n\n var _useMemo = useMemo(function () {\n var filteredOptionsList = filteredOptions().filter(function (o) {\n return !o.disabled;\n });\n return [filteredOptionsList.every(function (o) {\n return value.findIndex(function (v) {\n return v.value === o.value;\n }) !== -1;\n }), filteredOptionsList.length !== 0]; // eslint-disable-next-line\n }, [searchText, value]),\n isAllOptionSelected = _useMemo[0],\n hasSelectableOptions = _useMemo[1];\n\n return React.createElement(\"div\", {\n className: \"select-panel\",\n role: \"listbox\",\n onKeyDown: handleKeyDown\n }, !disableSearch && React.createElement(\"div\", {\n className: SelectSearchContainer\n }, React.createElement(\"input\", {\n autoFocus: focusSearchOnOpen,\n placeholder: t(\"search\"),\n type: \"text\",\n \"aria-describedby\": t(\"search\"),\n onKeyDown: function onKeyDown(e) {\n return e.stopPropagation();\n },\n onChange: handleSearchChange,\n onFocus: handleSearchFocus,\n value: searchText\n }), React.createElement(\"button\", {\n type: \"button\",\n className: cn(SearchClearButton, \"search-clear-button\"),\n hidden: !searchText,\n onClick: handleClear,\n \"aria-label\": t(\"clearSearch\")\n }, ClearIcon || React.createElement(Cross, null))), hasSelectAll && hasSelectableOptions && React.createElement(SelectItem, {\n focused: focusIndex === 1,\n tabIndex: 1,\n checked: isAllOptionSelected,\n option: selectAllOption,\n onSelectionChanged: selectAllChanged,\n onClick: function onClick() {\n return handleItemClicked(1);\n },\n itemRenderer: ItemRenderer,\n disabled: disabled\n }), React.createElement(SelectList, {\n options: filteredOptions(),\n focusIndex: focusIndex,\n onClick: function onClick(_e, index) {\n return handleItemClicked(index);\n }\n }));\n};\n\nvar Arrow = function Arrow(_ref) {\n var expanded = _ref.expanded;\n return React.createElement(\"svg\", {\n width: \"24\",\n height: \"24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"2\",\n className: \"dropdown-heading-dropdown-arrow gray\"\n }, React.createElement(\"path\", {\n d: expanded ? \"M18 15 12 9 6 15\" : \"M6 9L12 15 18 9\"\n }));\n};\n\nvar DropdownHeader = function DropdownHeader() {\n var _useMultiSelect = useMultiSelect(),\n t = _useMultiSelect.t,\n value = _useMultiSelect.value,\n options = _useMultiSelect.options,\n valueRenderer = _useMultiSelect.valueRenderer;\n\n var noneSelected = value.length === 0;\n var allSelected = value.length === options.length;\n var customText = valueRenderer && valueRenderer(value, options);\n\n var getSelectedText = function getSelectedText() {\n return value.map(function (s) {\n return s.label;\n }).join(\", \");\n };\n\n return noneSelected ? React.createElement(\"span\", {\n className: \"gray\"\n }, customText || t(\"selectSomeItems\")) : React.createElement(\"span\", null, customText || (allSelected ? t(\"allItemsAreSelected\") : getSelectedText()));\n};\n\nvar Spinner = /*#__PURE__*/css({\n animation: \"rotate 2s linear infinite\",\n \"& .path\": {\n stroke: \"var(--rmsc-border)\",\n strokeWidth: \"4px\",\n strokeLinecap: \"round\",\n animation: \"dash 1.5s ease-in-out infinite\"\n },\n \"@keyframes rotate\": {\n \"100%\": {\n transform: \"rotate(360deg)\"\n }\n },\n \"@keyframes dash\": {\n \"0%\": {\n strokeDasharray: \"1,150\",\n strokeDashoffset: 0\n },\n \"50%\": {\n strokeDasharray: \"90,150\",\n strokeDashoffset: \"-35\"\n },\n \"100%\": {\n strokeDasharray: \"90,150\",\n strokeDashoffset: \"-124\"\n }\n }\n});\nvar Loading = function Loading(_ref) {\n var _ref$size = _ref.size,\n size = _ref$size === void 0 ? 24 : _ref$size;\n return React.createElement(\"span\", {\n style: {\n width: size,\n marginRight: \"0.2rem\"\n }\n }, React.createElement(\"svg\", {\n width: size,\n height: size,\n className: Spinner,\n viewBox: \"0 0 50 50\",\n style: {\n display: \"inline\",\n verticalAlign: \"middle\"\n }\n }, React.createElement(\"circle\", {\n cx: \"25\",\n cy: \"25\",\n r: \"20\",\n fill: \"none\",\n className: \"path\"\n })));\n};\n\n/**\r\n * A generic dropdown component. It takes the children of the component\r\n * and hosts it in the component. When the component is selected, it\r\n * drops-down the contentComponent and applies the contentProps.\r\n */\nvar PanelContainer = /*#__PURE__*/css({\n position: \"absolute\",\n zIndex: 1,\n top: \"100%\",\n width: \"100%\",\n paddingTop: \"8px\",\n \".panel-content\": {\n maxHeight: \"300px\",\n overflowY: \"auto\",\n borderRadius: \"var(--rmsc-radius)\",\n background: \"var(--rmsc-bg)\",\n boxShadow: \"0 0 0 1px rgba(0, 0, 0, 0.1), 0 4px 11px rgba(0, 0, 0, 0.1)\"\n }\n});\nvar DropdownContainer = /*#__PURE__*/css({\n position: \"relative\",\n outline: 0,\n backgroundColor: \"var(--rmsc-bg)\",\n border: \"1px solid var(--rmsc-border)\",\n borderRadius: \"var(--rmsc-radius)\",\n \"&:focus-within\": {\n boxShadow: \"var(--rmsc-main) 0 0 0 1px\",\n borderColor: \"var(--rmsc-main)\"\n }\n});\nvar DropdownHeading = /*#__PURE__*/css({\n position: \"relative\",\n padding: \"0 var(--rmsc-p)\",\n display: \"flex\",\n alignItems: \"center\",\n width: \"100%\",\n height: \"var(--rmsc-h)\",\n cursor: \"default\",\n outline: 0,\n \".dropdown-heading-value\": {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n flex: 1\n }\n});\nvar ClearSelectedButton = /*#__PURE__*/css({\n cursor: \"pointer\",\n background: \"none\",\n border: 0,\n padding: 0,\n display: \"flex\"\n});\n\nvar Dropdown = function Dropdown() {\n var _useMultiSelect = useMultiSelect(),\n t = _useMultiSelect.t,\n onMenuToggle = _useMultiSelect.onMenuToggle,\n ArrowRenderer = _useMultiSelect.ArrowRenderer,\n shouldToggleOnHover = _useMultiSelect.shouldToggleOnHover,\n isLoading = _useMultiSelect.isLoading,\n disabled = _useMultiSelect.disabled,\n onChange = _useMultiSelect.onChange,\n labelledBy = _useMultiSelect.labelledBy,\n value = _useMultiSelect.value,\n isOpen = _useMultiSelect.isOpen,\n defaultIsOpen = _useMultiSelect.defaultIsOpen,\n ClearSelectedIcon = _useMultiSelect.ClearSelectedIcon;\n\n var _useState = useState(true),\n isInternalExpand = _useState[0],\n setIsInternalExpand = _useState[1];\n\n var _useState2 = useState(defaultIsOpen),\n expanded = _useState2[0],\n setExpanded = _useState2[1];\n\n var _useState3 = useState(false),\n hasFocus = _useState3[0],\n setHasFocus = _useState3[1];\n\n var FinalArrow = ArrowRenderer || Arrow;\n var wrapper = useRef();\n /* eslint-disable react-hooks/exhaustive-deps */\n\n useEffect(function () {\n onMenuToggle && onMenuToggle(expanded);\n }, [expanded]);\n useEffect(function () {\n if (defaultIsOpen === undefined && typeof isOpen === \"boolean\") {\n setIsInternalExpand(false);\n setExpanded(isOpen);\n }\n }, [isOpen]);\n\n var handleKeyDown = function handleKeyDown(e) {\n var _wrapper$current;\n\n if (isInternalExpand) {\n switch (e.which) {\n case 27: // Escape\n\n case 38:\n // Up Arrow\n setExpanded(false);\n wrapper == null ? void 0 : (_wrapper$current = wrapper.current) == null ? void 0 : _wrapper$current.focus();\n break;\n\n case 32: // Space\n\n case 13: // Enter Key\n\n case 40:\n // Down Arrow\n setExpanded(true);\n break;\n\n default:\n return;\n }\n }\n\n e.preventDefault();\n };\n\n var handleHover = function handleHover(iexpanded) {\n isInternalExpand && shouldToggleOnHover && setExpanded(iexpanded);\n };\n\n var handleFocus = function handleFocus() {\n return !hasFocus && setHasFocus(true);\n };\n\n var handleBlur = function handleBlur(e) {\n if (!e.currentTarget.contains(e.relatedTarget) && isInternalExpand) {\n setHasFocus(false);\n setExpanded(false);\n }\n };\n\n var handleMouseEnter = function handleMouseEnter() {\n return handleHover(true);\n };\n\n var handleMouseLeave = function handleMouseLeave() {\n return handleHover(false);\n };\n\n var toggleExpanded = function toggleExpanded() {\n isInternalExpand && setExpanded(isLoading || disabled ? false : !expanded);\n };\n\n var handleClearSelected = function handleClearSelected(e) {\n e.stopPropagation();\n onChange([]);\n isInternalExpand && setExpanded(false);\n };\n\n return React.createElement(\"div\", {\n tabIndex: 0,\n className: cn(DropdownContainer, \"dropdown-container\"),\n \"aria-labelledby\": labelledBy,\n \"aria-expanded\": expanded,\n \"aria-readonly\": true,\n \"aria-disabled\": disabled,\n ref: wrapper,\n onKeyDown: handleKeyDown,\n onFocus: handleFocus,\n onBlur: handleBlur,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave\n }, React.createElement(\"div\", {\n className: cn(DropdownHeading, \"dropdown-heading\"),\n onClick: toggleExpanded\n }, React.createElement(\"div\", {\n className: \"dropdown-heading-value\"\n }, React.createElement(DropdownHeader, null)), isLoading && React.createElement(Loading, null), value.length > 0 && React.createElement(\"button\", {\n type: \"button\",\n className: cn(ClearSelectedButton, \"clear-selected-button\"),\n onClick: handleClearSelected,\n disabled: disabled,\n \"aria-label\": t(\"clearSelected\")\n }, ClearSelectedIcon || React.createElement(Cross, null)), React.createElement(FinalArrow, {\n expanded: expanded\n })), expanded && React.createElement(\"div\", {\n className: cn(PanelContainer, \"dropdown-content\")\n }, React.createElement(\"div\", {\n className: \"panel-content\"\n }, React.createElement(SelectPanel, null))));\n};\n\nvar MultiSelectBox = /*#__PURE__*/css({\n \"--rmscMain\": \"#4285f4\",\n \"--rmscHover\": \"#f1f3f5\",\n \"--rmscSelected\": \"#e2e6ea\",\n \"--rmscBorder\": \"#ccc\",\n \"--rmscGray\": \"#aaa\",\n \"--rmscBg\": \"#fff\",\n \"--rmscP\": \"10px\",\n \"--rmscRadius\": \"4px\",\n \"--rmscH\": \"38px\",\n \"*\": {\n boxSizing: \"border-box\",\n transition: \"all 0.2s ease\"\n },\n \".gray\": {\n color: \"var(--rmsc-gray)\"\n }\n});\n\nvar MultiSelect = function MultiSelect(props) {\n return React.createElement(MultiSelectProvider, {\n props: props\n }, React.createElement(\"div\", {\n className: cn(MultiSelectBox, props.className || \"multi-select\")\n }, React.createElement(Dropdown, null)));\n};\n\nexport default MultiSelect;\nexport { Dropdown, SelectItem, SelectPanel };\n//# sourceMappingURL=react-multi-select-component.esm.js.map\n","import MultiSelect from \"react-multi-select-component\";\nimport { withState } from '@wordpress/compose';\n\nexport const ContentVisibilityGeolocationMultiSelect = withState( {\n option: [],\n} )( ( { option, setState, props, data, labelledBy, type } ) => {\n\n /**\n * onChange callback for the ContentVisibilityMultiSelect component. This handles setting the props and state for\n * this instance of the component.\n * \n * @param {array} option current value of what is selected.\n */\n const onChange = ( option ) => {\n\n // Set the state and props.\n setState( { option } );\n\n props.setAttributes( {\n contentVisibilityRules: {\n ...props.attributes.contentVisibilityRules,\n geolocation: {\n ...props.attributes.contentVisibilityRules.geolocation,\n [type]: option\n }\n },\n } );\n\n };\n\n return (\n <div className=\"content-visibility-multi-select\">\n <MultiSelect\n options={ data }\n value={ props.attributes.contentVisibilityRules.geolocation[type] || option }\n onChange={ onChange }\n labelledBy={ labelledBy }\n ItemRenderer={ ( { checked, option, onClick, disabled, } ) => {\n return (\n <div className={`item-renderer content-visibility-multi-select-item ${disabled && \"disabled\"}`}>\n <input type=\"checkbox\" onChange={ onClick } checked={ checked } tabIndex={ -1 } disabled={ disabled } />\n <span>{option.icon || \"\"} {option.label}</span>\n </div>\n );\n } }\n // isOpen={ true }\n />\n </div>\n );\n\n} );","import { PanelBody, PanelRow } from '@wordpress/components';\nimport { withInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\nimport { ContentVisibilityGeolocationMultiSelect } from '../controls/content-visibility-geolocation-multisitelect';\n\n/**\n * PHP sends through a list of all the users on the site. We massage that data to be\n * usable by our Dropdown.\n *\n */\nfunction getCountries() {\n\n const countries = [];\n\n if ( BlockVisibilityGeolocation.countries.length === 0 ) {\n return [ {\n label: __( 'No countries found.', 'content-visibility' ),\n value: 0,\n notes: '',\n } ]\n }\n\n for ( const country in BlockVisibilityGeolocation.countries ) {\n \n countries.push( { \n icon: BlockVisibilityGeolocation.countries[country].flag,\n label: BlockVisibilityGeolocation.countries[country].name,\n value: BlockVisibilityGeolocation.countries[country].code,\n } );\n \n }\n\n return countries;\n\n}// end getCountries()\n\nfunction ContentVisibilityGeolocationBodyControl( { instanceId, props } ) {\n\n const data = getCountries();\n const type = 'geolocation';\n\n return (\n <PanelBody\n title={ __( 'Geolocation', 'content-visibility-geolocation' ) }\n initialOpen={ false }\n className=\"content-visibility-control-panel content-visibility-geolocation-controls\"\n >\n <PanelRow>\n <ContentVisibilityGeolocationMultiSelect data={ data } labelledBy=\"Select Specific Users\" props={ props } type={ type } />\n </PanelRow>\n\n { props.attributes.contentVisibility && (\n <p className=\"geolocation-help-intro content-visibility-help-text\">{ __( 'Select one or more countries to whom this block will be ' + props.attributes.contentVisibility + '. If no countries are selected, this block will be ' + props.attributes.contentVisibility + ' regardless of a user\\'s location.', 'content-visibility-geolocation' ) }</p>\n ) }\n </PanelBody>\n );\n\n}\n\nexport default withInstanceId( ContentVisibilityGeolocationBodyControl );","import { Fill, Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\nimport ContentVisibilityGeolocationPanelBodyControl from './content-visibility-geolocation-panel-body';\n\nexport function ContentVisibilityGeolocationControl( data ) {\n\n let { props } = { ...data };\n\n let rulesEnabled = props.attributes.contentVisibilityRules.contentVisibilityRulesEnabled;\n let contentVisibility = props.attributes.hasOwnProperty( 'contentVisibility' );\n\n if ( ! rulesEnabled || ! contentVisibility ) {\n return (\n <Disabled><ContentVisibilityGeolocationPanelBodyControl props={ props } /></Disabled>\n );\n }\n\n return (\n <ContentVisibilityGeolocationPanelBodyControl props={ props } />\n );\n\n}\n\n/**\n * Render the <ContentVisibilityGeolocationControl> component by adding\n * it to the block-visibility-extra-controls Fill.\n *\n * @return {Object} A Fill component wrapping the ContentVisibilityGeolocationControl component.\n */\nfunction ContentVisibilityGeolocationFill() {\n return (\n <Fill name=\"content-visibility-extra-controls\">\n {\n ( fillProps ) => {\n return (\n <ContentVisibilityGeolocationControl props={ fillProps } />\n )\n }\n }\n </Fill>\n );\n\n}\n\n// Add our component to the Slot provided by BlockVisibilityControls\nregisterPlugin( 'content-visibility-05-geolocation-fill', { render: ContentVisibilityGeolocationFill } );\n\n\n// Register our visibility rule with the main plugin\naddFilter( 'contentVisibility.defaultContentVisibilityRules', 'content-visibility-geolocation/block-visibility-rules', registerContentVisibilityRule );\n\nfunction registerContentVisibilityRule( defaultRules ) {\n\n defaultRules.geolocation = {};\n\n return defaultRules;\n\n}\n","// extracted by mini-css-extract-plugin","import './editor.scss';\nimport './style.scss';\n\nimport ContentVisibilityGeolocationControl from './controls/content-visibility-geolocation';","(function() { module.exports = this[\"wp\"][\"components\"]; }());","(function() { module.exports = this[\"wp\"][\"compose\"]; }());","(function() { module.exports = this[\"wp\"][\"element\"]; }());","(function() { module.exports = this[\"wp\"][\"hooks\"]; }());","(function() { module.exports = this[\"wp\"][\"i18n\"]; }());","(function() { module.exports = this[\"wp\"][\"plugins\"]; }());","(function() { module.exports = this[\"React\"]; }());"],"sourceRoot":""}1 {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/@babel/runtime/helpers/defineProperty.js","webpack:///./node_modules/goober/dist/goober.esm.js","webpack:///./node_modules/react-multi-select-component/dist/react-multi-select-component.esm.js","webpack:///./src/controls/content-visibility-geolocation-multisitelect.js","webpack:///./src/controls/content-visibility-geolocation-panel-body.js","webpack:///./src/controls/content-visibility-geolocation.js","webpack:///./src/editor.scss","webpack:///./src/helpers/has-rules.js","webpack:///./src/index.js","webpack:///external {\"this\":[\"wp\",\"components\"]}","webpack:///external {\"this\":[\"wp\",\"compose\"]}","webpack:///external {\"this\":[\"wp\",\"element\"]}","webpack:///external {\"this\":[\"wp\",\"hooks\"]}","webpack:///external {\"this\":[\"wp\",\"i18n\"]}","webpack:///external {\"this\":[\"wp\",\"plugins\"]}","webpack:///external {\"this\":\"React\"}"],"names":["ContentVisibilityGeolocationMultiSelect","withState","option","setState","props","data","labelledBy","type","onChange","setAttributes","contentVisibilityRules","attributes","geolocation","checked","onClick","disabled","icon","label","getCountries","countries","BlockVisibilityGeolocation","length","__","value","notes","country","push","flag","name","code","ContentVisibilityGeolocationBodyControl","instanceId","hasRulesClass","hasRules","contentVisibility","withInstanceId","ContentVisibilityGeolocationControl","rulesEnabled","contentVisibilityRulesEnabled","hasOwnProperty","ContentVisibilityGeolocationFill","fillProps","registerPlugin","render","addFilter","registerContentVisibilityRule","defaultRules","applyFilters"],"mappings":";;;;;;;;;;;;;;;;QAAA;QACA;QACA;QACA;QACA;;QAEA;QACA;QACA;QACA,QAAQ,oBAAoB;QAC5B;QACA;QACA;QACA;QACA;QAC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4G,UAAU,gCAAgC,WAAW,EAAE,KAAK,0BAA0B,yDAAyD,0BAA0B,YAAY,KAAK,UAAU,oBAAoB,eAAe,iBAAiB,oDAAoD,cAAc,+BAA+B,WAAW,cAAc,6DAA6D,qDAAqD,0BAA0B,KAAK,cAAc,cAAc,mBAAmB,oHAAoH,6BAA6B,oBAAoB,IAAI,YAAY,IAAI,EAAE,oBAAoB,kBAAkB,gBAAgB,eAAe,kBAAkB,gBAAgB,gBAAgB,sBAAsB,+BAA+B,mBAAmB,aAAa,8EAA8E,cAAc,4BAA4B,iBAAkG;;;;;;;;;;;;;ACA1oE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA6B;AACoD;;AAEjF;AACA;AACA,mBAAmB,sBAAsB;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,4CAAK,iBAAiB;AAC5D;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,SAAS,4CAAK;AACd;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,SAAS,4CAAK;AACd;;AAEA;AACA;AACA;AACA,WAAW,EAAE;AACb;AACA;AACA,wEAAwE,aAAa;AACrF;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,uEAAuE,aAAa;AACpF;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,eAAe,cAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA,GAAG,mCAAmC;AACtC;AACA;;;AAGA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,iBAAiB,cAAc;AAC/B;AACA;;AAEA,iBAAiB,cAAc;AAC/B;AACA,GAAG;;;AAGH,kBAAkB,eAAe;AACjC,oBAAoB,eAAe;AACnC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;;AAEA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA,GAAG,GAAG,4CAAK;AACX;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA,mCAAmC,kDAAG;AACtC;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,SAAS,4CAAK;AACd;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA;AACA,GAAG,GAAG,4CAAK;AACX;;AAEA;AACA;AACA;AACA,iCAAiC,kDAAG;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oDAAM;AACtB,EAAE,uDAAS;AACX,kBAAkB;AAClB,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,gCAAgC,kDAAG;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA,SAAS,4CAAK;AACd;AACA,GAAG;AACH;AACA,WAAW,4CAAK;AAChB;AACA,KAAK,EAAE,4CAAK;AACZ;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC,8BAA8B;;AAE/B,yCAAyC,kDAAG;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qCAAqC,kDAAG;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,sDAAQ;AAC1B;AACA;;AAEA,mBAAmB,sDAAQ;AAC3B;AACA;;AAEA,mBAAmB,sDAAQ;AAC3B;AACA;;AAEA,wBAAwB,yDAAW;AACnC;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;;AAEL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,qDAAO;AACxB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP,KAAK,qCAAqC;AAC1C,GAAG;AACH;AACA;;AAEA,SAAS,4CAAK;AACd;AACA;AACA;AACA,GAAG,oBAAoB,4CAAK;AAC5B;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG,GAAG,4CAAK;AACX;AACA;AACA;AACA;AACA;AACA,GAAG,eAAe,4CAAK,uEAAuE,4CAAK;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG,GAAG,4CAAK;AACX;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA,wBAAwB,4CAAK;AAC7B;AACA,GAAG,wCAAwC,4CAAK;AAChD;;AAEA,2BAA2B,kDAAG;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,kCAAkC,kDAAG;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qCAAqC,kDAAG;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,mCAAmC,kDAAG;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,uCAAuC,kDAAG;AAC1C;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,sDAAQ;AAC1B;AACA;;AAEA,mBAAmB,sDAAQ;AAC3B;AACA;;AAEA,mBAAmB,sDAAQ;AAC3B;AACA;;AAEA;AACA,gBAAgB,oDAAM;AACtB;;AAEA,EAAE,uDAAS;AACX;AACA,GAAG;AACH,EAAE,uDAAS;AACX;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,SAAS,4CAAK;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA;AACA,GAAG,EAAE,4CAAK;AACV;AACA,GAAG,EAAE,4CAAK,oDAAoD,4CAAK,mDAAmD,4CAAK;AAC3H;AACA;AACA;AACA;AACA;AACA,GAAG,uBAAuB,4CAAK,8BAA8B,4CAAK;AAClE;AACA,GAAG,gBAAgB,4CAAK;AACxB;AACA,GAAG,EAAE,4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AACO,UAAN,CAAiBD,sBAAjB,CAAwCH,IAAxC,EAA8CA,IAA9C,CAAjD,IAAwGH,KAAK,CAACO,UAAN,CAAiBD,sBAAjB,CAAwCH,IAAxC,EAA8CA,IAA9C,EAAoDc,MAApD,IAA8D,CAA3K,EAA+K;AAC3KY,gBAAQ,GAAG,IAAX;AACH;;AAED;;AAEJ;AACI;AAXR;;AAcA,SAAOc,qEAAY,CAAE,8BAAF,EAAkCd,QAAlC,EAA4C7B,KAA5C,EAAmDG,IAAnD,CAAnB;AAEH,C,CAAA;;;AAEc0B,uEAAf,E;;;;;;;;;;;;ACzCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;;;;;;;;;;;;ACDA,aAAa,2CAA2C,EAAE,I;;;;;;;;;;;ACA1D,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,sCAAsC,EAAE,I;;;;;;;;;;;ACArD,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,gCAAgC,EAAE,I","file":"index.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"index\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([\"./src/index.js\",\"style-index\"]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","let e={data:\"\"},t=t=>{if(\"undefined\"!=typeof window){let e=t?t.querySelector(\"#_goober\"):window._goober;return e||(e=(t||document.head).appendChild(document.createElement(\"style\")),e.innerHTML=\" \",e.id=\"_goober\"),e.firstChild}return t||e},r=e=>{let r=t(e),l=r.data;return r.data=\"\",l},l=/(?:([A-Z0-9-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(})/gi,a=/\\/\\*[\\s\\S]*?\\*\\/|\\s{2,}|\\n/gm,n=(e,t)=>{let r,l=\"\",a=\"\",o=\"\";for(let c in e){let s=e[c];\"object\"==typeof s?(r=t?t.replace(/([^,])+/g,e=>c.replace(/([^,])+/g,t=>/&/g.test(t)?t.replace(/&/g,e):e?e+\" \"+t:t)):c,a+=\"@\"==c[0]?\"f\"==c[1]?n(s,c):c+\"{\"+n(s,\"k\"==c[1]?\"\":t)+\"}\":n(s,r)):\"@\"==c[0]&&\"i\"==c[1]?l=c+\" \"+s+\";\":o+=n.p?n.p(c.replace(/[A-Z]/g,\"-$&\").toLowerCase(),s):c.replace(/[A-Z]/g,\"-$&\").toLowerCase()+\":\"+s+\";\"}return o[0]?(r=t?t+\"{\"+o+\"}\":o,l+r+a):l+a},o={},c=e=>{let t=\"\";for(let r in e)t+=r+(\"object\"==typeof e[r]?c(e[r]):e[r]);return t},s=(e,t,r,s,i)=>{let p=\"object\"==typeof e?c(e):e,u=o[p]||(o[p]=\"go\"+p.split(\"\").reduce((e,t)=>101*e+t.charCodeAt(0)>>>0,11));if(!o[u]){let t=\"object\"==typeof e?e:(e=>{let t,r=[{}];for(;t=l.exec(e.replace(a,\"\"));)t[4]&&r.shift(),t[3]?r.unshift(r[0][t[3]]=r[0][t[3]]||{}):t[4]||(r[0][t[1]]=t[2]);return r[0]})(e);o[u]=n(i?{[\"@keyframes \"+u]:t}:t,r?\"\":\".\"+u)}return((e,t,r)=>{-1==t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e)})(o[u],t,s),u},i=(e,t,r)=>e.reduce((e,l,a)=>{let o=t[a];if(o&&o.call){let e=o(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?\".\"+t:e&&\"object\"==typeof e?e.props?\"\":n(e,\"\"):e}return e+l+(null==o?\"\":o)},\"\");function p(e){let r=this||{},l=e.call?e(r.p):e;return s(l.unshift?l.raw?i(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>t?Object.assign(e,t.call?t(r.p):t):e,{}):l,t(r.target),r.g,r.o,r.k)}let u,d,f,g=p.bind({g:1}),b=p.bind({k:1});function h(e,t,r,l){n.p=t,u=e,d=r,f=l}function m(e,t){let r=this||{};return function(){let l=arguments;function a(n,o){let c=Object.assign({},n),s=c.className||a.className;r.p=Object.assign({theme:d&&d()},c),r.o=/ *go\\d+/g.test(s),c.className=p.apply(r,l)+(s?\" \"+s:\"\"),t&&(c.ref=o);let i=c.as||e;return f&&i[0]&&f(c),u(i,c)}return t?t(a):a}}export{p as css,r as extractCss,g as glob,b as keyframes,h as setup,m as styled};\n","import { css } from 'goober';\nimport React, { useRef, useEffect, useState, useCallback, useMemo } from 'react';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nvar defaultStrings = {\n selectSomeItems: \"Select...\",\n allItemsAreSelected: \"All items are selected.\",\n selectAll: \"Select All\",\n search: \"Search\",\n clearSearch: \"Clear Search\",\n clearSelected: \"Clear Selected\"\n};\nvar defaultProps = {\n value: [],\n focusSearchOnOpen: true,\n hasSelectAll: true,\n className: \"multi-select\",\n debounceDuration: 300,\n options: []\n};\nvar MultiSelectContext = /*#__PURE__*/React.createContext({});\nvar MultiSelectProvider = function MultiSelectProvider(_ref) {\n var props = _ref.props,\n children = _ref.children;\n\n var t = function t(key) {\n var _props$overrideString;\n\n return ((_props$overrideString = props.overrideStrings) == null ? void 0 : _props$overrideString[key]) || defaultStrings[key];\n };\n\n return React.createElement(MultiSelectContext.Provider, {\n value: _extends({\n t: t\n }, defaultProps, props)\n }, children);\n};\nvar useMultiSelect = function useMultiSelect() {\n return React.useContext(MultiSelectContext);\n};\n\n/**\r\n * combines classNames in a friendly way\r\n *\r\n * @param {*} classes\r\n */\nvar cn = function cn() {\n for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) {\n classes[_key] = arguments[_key];\n }\n\n return classes.join(\" \");\n};\n\nvar debounce = function debounce(func, wait) {\n var timeout;\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n func.apply(null, args);\n }, wait);\n };\n};\n\n/**\r\n * Filters React Select options and sorts by similarity to a search filter.\r\n * Handles partial matches, eg. searching for \"Waberg High\" will find \"Raoul\r\n * Wallenberg Traditional High School\". Case insensitive. Ignores\r\n * non-alphanumeric characters.\r\n *\r\n * @param options An unfiltered list of Options.\r\n * @param? filter A string to compare against Option labels.\r\n * @param? substitutions Strings with multiple spellings or variations that we\r\n * expect to match, eg. accented characters or abbreviated words.\r\n *\r\n * @return A filtered and sorted array of Options.\r\n */\nfunction filterOptions(options, filter, substitutions) {\n // If the filter is blank, return the full list of Options.\n if (!filter) {\n return options;\n }\n\n var cleanFilter = cleanUpText(filter, substitutions);\n return options // Filter out undefined or null Options.\n .filter(function (_ref) {\n var label = _ref.label,\n value = _ref.value;\n return label != null && value != null;\n }) // Create a {score, Option} pair for each Option based on its label's\n // similarity to the filter text.\n .map(function (option) {\n return {\n option: option,\n score: typeaheadSimilarity(cleanUpText(option.label, substitutions), cleanFilter)\n };\n }) // Only include matches of the entire substring, with a slight\n // affordance for transposition or extra characters.\n .filter(function (pair) {\n return pair.score >= cleanFilter.length - 2;\n }) // Sort 'em by order of their score.\n .sort(function (a, b) {\n return b.score - a.score;\n }) // …and grab the original Options back from their pairs.\n .map(function (pair) {\n return pair.option;\n });\n}\n/**\r\n * Scores the similarity between two strings by returning the length of the\r\n * longest common subsequence. Intended for comparing strings of different\r\n * lengths; eg. when matching a typeahead search input with a school name.\r\n\n * Meant for use in an instant search box where results are being fetched\r\n * as a user is typing.\r\n *\r\n * @param a The longer string (though, we flip them if it's shorter).\r\n * @param b The shorter string, eg. a typeahead search input.\r\n *\r\n * @return The length of the longest common subsequence. Higher scores indicate\r\n * closer matches.\r\n */\n\nfunction typeaheadSimilarity(a, b) {\n var aLength = a.length;\n var bLength = b.length;\n var table = [];\n\n if (!aLength || !bLength) {\n return 0;\n } // Ensure `a` isn't shorter than `b`.\n\n\n if (aLength < bLength) {\n var _ref2 = [b, a];\n a = _ref2[0];\n b = _ref2[1];\n } // Early exit if `a` includes `b`; these will be scored higher than any\n // other options with the same `b` (filter string), with a preference for\n // shorter `a` strings (option labels).\n\n\n if (a.indexOf(b) !== -1) {\n return bLength + 1 / aLength;\n } // Initialize the table axes:\n //\n // 0 0 0 0 ... bLength\n // 0\n // 0\n //\n // ...\n //\n // aLength\n //\n\n\n for (var x = 0; x <= aLength; ++x) {\n table[x] = [0];\n }\n\n for (var y = 0; y <= bLength; ++y) {\n table[0][y] = 0;\n } // Populate the rest of the table with a dynamic programming algorithm.\n\n\n for (var _x = 1; _x <= aLength; ++_x) {\n for (var _y = 1; _y <= bLength; ++_y) {\n table[_x][_y] = a[_x - 1] === b[_y - 1] ? 1 + table[_x - 1][_y - 1] : Math.max(table[_x][_y - 1], table[_x - 1][_y]);\n }\n }\n\n return table[aLength][bLength];\n}\n/**\r\n * Apply string substitutions, remove non-alphanumeric characters, and convert\r\n * all letters to uppercase.\r\n *\r\n * eg. 'Scoil Bhríde Primary School' may become 'SCOILBHRIDEPRIMARYSCHOOL'.\r\n *\r\n * @param input An unsanitized input string.\r\n * @param substitutions Strings with multiple spellings or variations that we\r\n * expect to match, for example accented characters or abbreviated\r\n * words.\r\n *\r\n * @return The sanitized text.\r\n */\n\nfunction cleanUpText(input, substitutions) {\n if (!input) {\n return \"\";\n } // Uppercase and remove all non-alphanumeric, non-accented characters.\n // Also remove underscores.\n\n\n input = input.toUpperCase().replace(/((?=[^\\u00E0-\\u00FC])\\W)|_/g, \"\");\n\n if (!substitutions) {\n return input;\n }\n\n var safeSubstitutions = substitutions; // For Flow.\n // Replace all strings in `safeSubstitutions` with their standardized\n // counterparts.\n\n return Object.keys(safeSubstitutions).reduce(function (output, substitution) {\n var unsubbed = new RegExp(substitution, \"g\");\n return output.replace(unsubbed, safeSubstitutions[substitution]);\n }, input);\n}\n\nvar Cross = function Cross() {\n return React.createElement(\"svg\", {\n width: \"24\",\n height: \"24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"2\",\n className: \"dropdown-search-clear-icon gray\"\n }, React.createElement(\"line\", {\n x1: \"18\",\n y1: \"6\",\n x2: \"6\",\n y2: \"18\"\n }), React.createElement(\"line\", {\n x1: \"6\",\n y1: \"6\",\n x2: \"18\",\n y2: \"18\"\n }));\n};\n\nvar DefaultRenderer = /*#__PURE__*/css({\n \"& input,& span\": {\n verticalAlign: \"middle\",\n margin: 0\n },\n span: {\n display: \"inline-block\",\n paddingLeft: \"5px\"\n },\n \"&.disabled\": {\n opacity: 0.5\n }\n});\n\nvar DefaultItemRenderer = function DefaultItemRenderer(_ref) {\n var checked = _ref.checked,\n option = _ref.option,\n onClick = _ref.onClick,\n disabled = _ref.disabled;\n return React.createElement(\"div\", {\n className: cn(DefaultRenderer, \"item-renderer\", disabled && \"disabled\")\n }, React.createElement(\"input\", {\n type: \"checkbox\",\n onChange: onClick,\n checked: checked,\n tabIndex: -1,\n disabled: disabled\n }), React.createElement(\"span\", null, option.label));\n};\n\n/**\r\n * This component represents an individual item in the multi-select drop-down\r\n */\nvar ItemContainer = /*#__PURE__*/css({\n boxSizing: \"border-box\",\n cursor: \"pointer\",\n display: \"block\",\n padding: \"var(--rmsc-p)\",\n outline: 0,\n \"&:hover,&:focus\": {\n background: \"var(--rmsc-hover)\"\n },\n \"&.selected\": {\n background: \"var(--rmsc-selected)\"\n }\n});\n\nvar SelectItem = function SelectItem(_ref) {\n var _ref$itemRenderer = _ref.itemRenderer,\n ItemRenderer = _ref$itemRenderer === void 0 ? DefaultItemRenderer : _ref$itemRenderer,\n option = _ref.option,\n checked = _ref.checked,\n focused = _ref.focused,\n tabIndex = _ref.tabIndex,\n disabled = _ref.disabled,\n onSelectionChanged = _ref.onSelectionChanged,\n onClick = _ref.onClick;\n var itemRef = useRef();\n useEffect(function () {\n updateFocus(); // eslint-disable-next-line\n }, [checked, focused]);\n\n var toggleChecked = function toggleChecked() {\n onSelectionChanged(!checked);\n };\n\n var handleClick = function handleClick(e) {\n toggleChecked();\n onClick(e);\n };\n\n var updateFocus = function updateFocus() {\n if (focused && !disabled && itemRef) {\n itemRef.current.focus();\n }\n };\n\n var handleKeyDown = function handleKeyDown(e) {\n switch (e.which) {\n case 13: // Enter\n\n case 32:\n // Space\n toggleChecked();\n break;\n\n default:\n return;\n }\n\n e.preventDefault();\n };\n\n return React.createElement(\"label\", {\n className: cn(ItemContainer, \"select-item\", checked && \"selected\"),\n role: \"option\",\n \"aria-selected\": checked,\n tabIndex: tabIndex,\n ref: itemRef,\n onKeyDown: handleKeyDown\n }, React.createElement(ItemRenderer, {\n option: option,\n checked: checked,\n onClick: handleClick,\n disabled: disabled\n }));\n};\n\n/**\r\n * This component represents an unadorned list of SelectItem (s).\r\n */\nvar SelectListUl = /*#__PURE__*/css({\n margin: 0,\n paddingLeft: 0,\n li: {\n listStyle: \"none\",\n margin: 0\n }\n});\nvar skipIndex = 2;\n\nvar SelectList = function SelectList(_ref) {\n var options = _ref.options,\n focusIndex = _ref.focusIndex,\n _onClick = _ref.onClick;\n\n var _useMultiSelect = useMultiSelect(),\n disabled = _useMultiSelect.disabled,\n value = _useMultiSelect.value,\n onChange = _useMultiSelect.onChange,\n ItemRenderer = _useMultiSelect.ItemRenderer;\n\n var handleSelectionChanged = function handleSelectionChanged(option, checked) {\n if (disabled) {\n return;\n }\n\n onChange(checked ? [].concat(value, [option]) : value.filter(function (o) {\n return o.value !== option.value;\n }));\n };\n\n return React.createElement(\"ul\", {\n className: SelectListUl\n }, options.map(function (o, i) {\n var tabIndex = i + skipIndex;\n return React.createElement(\"li\", {\n key: (o == null ? void 0 : o.key) || i\n }, React.createElement(SelectItem, {\n focused: focusIndex === tabIndex,\n tabIndex: tabIndex,\n option: o,\n onSelectionChanged: function onSelectionChanged(c) {\n return handleSelectionChanged(o, c);\n },\n checked: value.find(function (s) {\n return s.value === o.value;\n }) ? true : false,\n onClick: function onClick(e) {\n return _onClick(e, tabIndex);\n },\n itemRenderer: ItemRenderer,\n disabled: o.disabled || disabled\n }));\n }));\n};\n\n/**\r\n * This component represents the entire panel which gets dropped down when the\r\n * user selects the component. It encapsulates the search filter, the\r\n * Select-all item, and the list of options.\r\n */\nvar FocusType;\n\n(function (FocusType) {\n FocusType[FocusType[\"SEARCH\"] = -1] = \"SEARCH\";\n FocusType[FocusType[\"NONE\"] = 1] = \"NONE\";\n})(FocusType || (FocusType = {}));\n\nvar SelectSearchContainer = /*#__PURE__*/css({\n width: \"100%\",\n position: \"relative\",\n borderBottom: \"1px solid var(--rmsc-border)\",\n input: {\n height: \"var(--rmsc-h)\",\n padding: \"0 var(--rmsc-p)\",\n width: \"100%\",\n outline: 0,\n border: 0\n }\n});\nvar SearchClearButton = /*#__PURE__*/css({\n cursor: \"pointer\",\n position: \"absolute\",\n top: 0,\n right: 0,\n bottom: 0,\n background: \"none\",\n border: 0,\n padding: \"0 calc(var(--rmsc-p)/2)\",\n \"[hidden]\": {\n display: \"none\"\n }\n});\n\nvar SelectPanel = function SelectPanel() {\n var _useMultiSelect = useMultiSelect(),\n t = _useMultiSelect.t,\n onChange = _useMultiSelect.onChange,\n options = _useMultiSelect.options,\n value = _useMultiSelect.value,\n customFilterOptions = _useMultiSelect.filterOptions,\n selectAllLabel = _useMultiSelect.selectAllLabel,\n ItemRenderer = _useMultiSelect.ItemRenderer,\n disabled = _useMultiSelect.disabled,\n disableSearch = _useMultiSelect.disableSearch,\n focusSearchOnOpen = _useMultiSelect.focusSearchOnOpen,\n hasSelectAll = _useMultiSelect.hasSelectAll,\n ClearIcon = _useMultiSelect.ClearIcon,\n debounceDuration = _useMultiSelect.debounceDuration;\n\n var _useState = useState(\"\"),\n searchText = _useState[0],\n setSearchText = _useState[1];\n\n var _useState2 = useState(\"\"),\n searchTextForFilter = _useState2[0],\n setSearchTextForFilter = _useState2[1];\n\n var _useState3 = useState(focusSearchOnOpen && !disableSearch ? FocusType.SEARCH : FocusType.NONE),\n focusIndex = _useState3[0],\n setFocusIndex = _useState3[1];\n\n var debouncedSearch = useCallback(debounce(function (query) {\n return setSearchTextForFilter(query);\n }, debounceDuration), []);\n var selectAllOption = {\n label: selectAllLabel || t(\"selectAll\"),\n value: \"\"\n };\n\n var selectAllValues = function selectAllValues(checked) {\n var filteredValues = filteredOptions().filter(function (o) {\n return !o.disabled;\n }).map(function (o) {\n return o.value;\n });\n\n if (checked) {\n var selectedValues = value.map(function (o) {\n return o.value;\n });\n var finalSelectedValues = [].concat(selectedValues, filteredValues);\n return options.filter(function (o) {\n return finalSelectedValues.includes(o.value);\n });\n }\n\n return value.filter(function (o) {\n return !filteredValues.includes(o.value);\n });\n };\n\n var selectAllChanged = function selectAllChanged(checked) {\n var newOptions = selectAllValues(checked);\n onChange(newOptions);\n };\n\n var handleSearchChange = function handleSearchChange(e) {\n debouncedSearch(e.target.value);\n setSearchText(e.target.value);\n setFocusIndex(FocusType.SEARCH);\n };\n\n var handleClear = function handleClear() {\n setSearchTextForFilter(\"\");\n setSearchText(\"\");\n };\n\n var handleItemClicked = function handleItemClicked(index) {\n return setFocusIndex(index);\n };\n\n var handleKeyDown = function handleKeyDown(e) {\n switch (e.which) {\n case 38:\n // Up Arrow\n if (e.altKey) {\n return;\n }\n\n updateFocus(-1);\n break;\n\n case 40:\n // Down Arrow\n if (e.altKey) {\n return;\n }\n\n updateFocus(1);\n break;\n\n default:\n return;\n }\n\n e.stopPropagation();\n e.preventDefault();\n };\n\n var handleSearchFocus = function handleSearchFocus() {\n setFocusIndex(FocusType.SEARCH);\n };\n\n var filteredOptions = function filteredOptions() {\n return customFilterOptions ? customFilterOptions(options, searchTextForFilter) : filterOptions(options, searchTextForFilter);\n };\n\n var updateFocus = function updateFocus(offset) {\n var newFocus = focusIndex + offset;\n newFocus = Math.max(1, newFocus);\n newFocus = Math.min(newFocus, options.length + 1);\n setFocusIndex(newFocus);\n };\n\n var _useMemo = useMemo(function () {\n var filteredOptionsList = filteredOptions().filter(function (o) {\n return !o.disabled;\n });\n return [filteredOptionsList.every(function (o) {\n return value.findIndex(function (v) {\n return v.value === o.value;\n }) !== -1;\n }), filteredOptionsList.length !== 0]; // eslint-disable-next-line\n }, [searchText, value]),\n isAllOptionSelected = _useMemo[0],\n hasSelectableOptions = _useMemo[1];\n\n return React.createElement(\"div\", {\n className: \"select-panel\",\n role: \"listbox\",\n onKeyDown: handleKeyDown\n }, !disableSearch && React.createElement(\"div\", {\n className: SelectSearchContainer\n }, React.createElement(\"input\", {\n autoFocus: focusSearchOnOpen,\n placeholder: t(\"search\"),\n type: \"text\",\n \"aria-describedby\": t(\"search\"),\n onKeyDown: function onKeyDown(e) {\n return e.stopPropagation();\n },\n onChange: handleSearchChange,\n onFocus: handleSearchFocus,\n value: searchText\n }), React.createElement(\"button\", {\n type: \"button\",\n className: cn(SearchClearButton, \"search-clear-button\"),\n hidden: !searchText,\n onClick: handleClear,\n \"aria-label\": t(\"clearSearch\")\n }, ClearIcon || React.createElement(Cross, null))), hasSelectAll && hasSelectableOptions && React.createElement(SelectItem, {\n focused: focusIndex === 1,\n tabIndex: 1,\n checked: isAllOptionSelected,\n option: selectAllOption,\n onSelectionChanged: selectAllChanged,\n onClick: function onClick() {\n return handleItemClicked(1);\n },\n itemRenderer: ItemRenderer,\n disabled: disabled\n }), React.createElement(SelectList, {\n options: filteredOptions(),\n focusIndex: focusIndex,\n onClick: function onClick(_e, index) {\n return handleItemClicked(index);\n }\n }));\n};\n\nvar Arrow = function Arrow(_ref) {\n var expanded = _ref.expanded;\n return React.createElement(\"svg\", {\n width: \"24\",\n height: \"24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"2\",\n className: \"dropdown-heading-dropdown-arrow gray\"\n }, React.createElement(\"path\", {\n d: expanded ? \"M18 15 12 9 6 15\" : \"M6 9L12 15 18 9\"\n }));\n};\n\nvar DropdownHeader = function DropdownHeader() {\n var _useMultiSelect = useMultiSelect(),\n t = _useMultiSelect.t,\n value = _useMultiSelect.value,\n options = _useMultiSelect.options,\n valueRenderer = _useMultiSelect.valueRenderer;\n\n var noneSelected = value.length === 0;\n var allSelected = value.length === options.length;\n var customText = valueRenderer && valueRenderer(value, options);\n\n var getSelectedText = function getSelectedText() {\n return value.map(function (s) {\n return s.label;\n }).join(\", \");\n };\n\n return noneSelected ? React.createElement(\"span\", {\n className: \"gray\"\n }, customText || t(\"selectSomeItems\")) : React.createElement(\"span\", null, customText || (allSelected ? t(\"allItemsAreSelected\") : getSelectedText()));\n};\n\nvar Spinner = /*#__PURE__*/css({\n animation: \"rotate 2s linear infinite\",\n \"& .path\": {\n stroke: \"var(--rmsc-border)\",\n strokeWidth: \"4px\",\n strokeLinecap: \"round\",\n animation: \"dash 1.5s ease-in-out infinite\"\n },\n \"@keyframes rotate\": {\n \"100%\": {\n transform: \"rotate(360deg)\"\n }\n },\n \"@keyframes dash\": {\n \"0%\": {\n strokeDasharray: \"1,150\",\n strokeDashoffset: 0\n },\n \"50%\": {\n strokeDasharray: \"90,150\",\n strokeDashoffset: \"-35\"\n },\n \"100%\": {\n strokeDasharray: \"90,150\",\n strokeDashoffset: \"-124\"\n }\n }\n});\nvar Loading = function Loading(_ref) {\n var _ref$size = _ref.size,\n size = _ref$size === void 0 ? 24 : _ref$size;\n return React.createElement(\"span\", {\n style: {\n width: size,\n marginRight: \"0.2rem\"\n }\n }, React.createElement(\"svg\", {\n width: size,\n height: size,\n className: Spinner,\n viewBox: \"0 0 50 50\",\n style: {\n display: \"inline\",\n verticalAlign: \"middle\"\n }\n }, React.createElement(\"circle\", {\n cx: \"25\",\n cy: \"25\",\n r: \"20\",\n fill: \"none\",\n className: \"path\"\n })));\n};\n\n/**\r\n * A generic dropdown component. It takes the children of the component\r\n * and hosts it in the component. When the component is selected, it\r\n * drops-down the contentComponent and applies the contentProps.\r\n */\nvar PanelContainer = /*#__PURE__*/css({\n position: \"absolute\",\n zIndex: 1,\n top: \"100%\",\n width: \"100%\",\n paddingTop: \"8px\",\n \".panel-content\": {\n maxHeight: \"300px\",\n overflowY: \"auto\",\n borderRadius: \"var(--rmsc-radius)\",\n background: \"var(--rmsc-bg)\",\n boxShadow: \"0 0 0 1px rgba(0, 0, 0, 0.1), 0 4px 11px rgba(0, 0, 0, 0.1)\"\n }\n});\nvar DropdownContainer = /*#__PURE__*/css({\n position: \"relative\",\n outline: 0,\n backgroundColor: \"var(--rmsc-bg)\",\n border: \"1px solid var(--rmsc-border)\",\n borderRadius: \"var(--rmsc-radius)\",\n \"&:focus-within\": {\n boxShadow: \"var(--rmsc-main) 0 0 0 1px\",\n borderColor: \"var(--rmsc-main)\"\n }\n});\nvar DropdownHeading = /*#__PURE__*/css({\n position: \"relative\",\n padding: \"0 var(--rmsc-p)\",\n display: \"flex\",\n alignItems: \"center\",\n width: \"100%\",\n height: \"var(--rmsc-h)\",\n cursor: \"default\",\n outline: 0,\n \".dropdown-heading-value\": {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n flex: 1\n }\n});\nvar ClearSelectedButton = /*#__PURE__*/css({\n cursor: \"pointer\",\n background: \"none\",\n border: 0,\n padding: 0,\n display: \"flex\"\n});\n\nvar Dropdown = function Dropdown() {\n var _useMultiSelect = useMultiSelect(),\n t = _useMultiSelect.t,\n onMenuToggle = _useMultiSelect.onMenuToggle,\n ArrowRenderer = _useMultiSelect.ArrowRenderer,\n shouldToggleOnHover = _useMultiSelect.shouldToggleOnHover,\n isLoading = _useMultiSelect.isLoading,\n disabled = _useMultiSelect.disabled,\n onChange = _useMultiSelect.onChange,\n labelledBy = _useMultiSelect.labelledBy,\n value = _useMultiSelect.value,\n isOpen = _useMultiSelect.isOpen,\n defaultIsOpen = _useMultiSelect.defaultIsOpen,\n ClearSelectedIcon = _useMultiSelect.ClearSelectedIcon;\n\n var _useState = useState(true),\n isInternalExpand = _useState[0],\n setIsInternalExpand = _useState[1];\n\n var _useState2 = useState(defaultIsOpen),\n expanded = _useState2[0],\n setExpanded = _useState2[1];\n\n var _useState3 = useState(false),\n hasFocus = _useState3[0],\n setHasFocus = _useState3[1];\n\n var FinalArrow = ArrowRenderer || Arrow;\n var wrapper = useRef();\n /* eslint-disable react-hooks/exhaustive-deps */\n\n useEffect(function () {\n onMenuToggle && onMenuToggle(expanded);\n }, [expanded]);\n useEffect(function () {\n if (defaultIsOpen === undefined && typeof isOpen === \"boolean\") {\n setIsInternalExpand(false);\n setExpanded(isOpen);\n }\n }, [isOpen]);\n\n var handleKeyDown = function handleKeyDown(e) {\n var _wrapper$current;\n\n if (isInternalExpand) {\n switch (e.which) {\n case 27: // Escape\n\n case 38:\n // Up Arrow\n setExpanded(false);\n wrapper == null ? void 0 : (_wrapper$current = wrapper.current) == null ? void 0 : _wrapper$current.focus();\n break;\n\n case 32: // Space\n\n case 13: // Enter Key\n\n case 40:\n // Down Arrow\n setExpanded(true);\n break;\n\n default:\n return;\n }\n }\n\n e.preventDefault();\n };\n\n var handleHover = function handleHover(iexpanded) {\n isInternalExpand && shouldToggleOnHover && setExpanded(iexpanded);\n };\n\n var handleFocus = function handleFocus() {\n return !hasFocus && setHasFocus(true);\n };\n\n var handleBlur = function handleBlur(e) {\n if (!e.currentTarget.contains(e.relatedTarget) && isInternalExpand) {\n setHasFocus(false);\n setExpanded(false);\n }\n };\n\n var handleMouseEnter = function handleMouseEnter() {\n return handleHover(true);\n };\n\n var handleMouseLeave = function handleMouseLeave() {\n return handleHover(false);\n };\n\n var toggleExpanded = function toggleExpanded() {\n isInternalExpand && setExpanded(isLoading || disabled ? false : !expanded);\n };\n\n var handleClearSelected = function handleClearSelected(e) {\n e.stopPropagation();\n onChange([]);\n isInternalExpand && setExpanded(false);\n };\n\n return React.createElement(\"div\", {\n tabIndex: 0,\n className: cn(DropdownContainer, \"dropdown-container\"),\n \"aria-labelledby\": labelledBy,\n \"aria-expanded\": expanded,\n \"aria-readonly\": true,\n \"aria-disabled\": disabled,\n ref: wrapper,\n onKeyDown: handleKeyDown,\n onFocus: handleFocus,\n onBlur: handleBlur,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave\n }, React.createElement(\"div\", {\n className: cn(DropdownHeading, \"dropdown-heading\"),\n onClick: toggleExpanded\n }, React.createElement(\"div\", {\n className: \"dropdown-heading-value\"\n }, React.createElement(DropdownHeader, null)), isLoading && React.createElement(Loading, null), value.length > 0 && React.createElement(\"button\", {\n type: \"button\",\n className: cn(ClearSelectedButton, \"clear-selected-button\"),\n onClick: handleClearSelected,\n disabled: disabled,\n \"aria-label\": t(\"clearSelected\")\n }, ClearSelectedIcon || React.createElement(Cross, null)), React.createElement(FinalArrow, {\n expanded: expanded\n })), expanded && React.createElement(\"div\", {\n className: cn(PanelContainer, \"dropdown-content\")\n }, React.createElement(\"div\", {\n className: \"panel-content\"\n }, React.createElement(SelectPanel, null))));\n};\n\nvar MultiSelectBox = /*#__PURE__*/css({\n \"--rmscMain\": \"#4285f4\",\n \"--rmscHover\": \"#f1f3f5\",\n \"--rmscSelected\": \"#e2e6ea\",\n \"--rmscBorder\": \"#ccc\",\n \"--rmscGray\": \"#aaa\",\n \"--rmscBg\": \"#fff\",\n \"--rmscP\": \"10px\",\n \"--rmscRadius\": \"4px\",\n \"--rmscH\": \"38px\",\n \"*\": {\n boxSizing: \"border-box\",\n transition: \"all 0.2s ease\"\n },\n \".gray\": {\n color: \"var(--rmsc-gray)\"\n }\n});\n\nvar MultiSelect = function MultiSelect(props) {\n return React.createElement(MultiSelectProvider, {\n props: props\n }, React.createElement(\"div\", {\n className: cn(MultiSelectBox, props.className || \"multi-select\")\n }, React.createElement(Dropdown, null)));\n};\n\nexport default MultiSelect;\nexport { Dropdown, SelectItem, SelectPanel };\n//# sourceMappingURL=react-multi-select-component.esm.js.map\n","import MultiSelect from \"react-multi-select-component\";\nimport { withState } from '@wordpress/compose';\n\nexport const ContentVisibilityGeolocationMultiSelect = withState( {\n option: [],\n} )( ( { option, setState, props, data, labelledBy, type } ) => {\n\n /**\n * onChange callback for the ContentVisibilityMultiSelect component. This handles setting the props and state for\n * this instance of the component.\n * \n * @param {array} option current value of what is selected.\n */\n const onChange = ( option ) => {\n\n // Set the state and props.\n setState( { option } );\n\n props.setAttributes( {\n contentVisibilityRules: {\n ...props.attributes.contentVisibilityRules,\n geolocation: {\n ...props.attributes.contentVisibilityRules.geolocation,\n [type]: option\n }\n },\n } );\n\n };\n\n return (\n <div className=\"content-visibility-multi-select\">\n <MultiSelect\n options={ data }\n value={ props.attributes.contentVisibilityRules.geolocation[type] || option }\n onChange={ onChange }\n labelledBy={ labelledBy }\n ItemRenderer={ ( { checked, option, onClick, disabled, } ) => {\n return (\n <div className={`item-renderer content-visibility-multi-select-item ${disabled && \"disabled\"}`}>\n <input type=\"checkbox\" onChange={ onClick } checked={ checked } tabIndex={ -1 } disabled={ disabled } />\n <span>{option.icon || \"\"} {option.label}</span>\n </div>\n );\n } }\n // isOpen={ true }\n />\n </div>\n );\n\n} );","import { PanelBody, PanelRow } from '@wordpress/components';\nimport { withInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\nimport { ContentVisibilityGeolocationMultiSelect } from '../controls/content-visibility-geolocation-multisitelect';\nimport hasRules from '../helpers/has-rules';\n/**\n * PHP sends through a list of all the users on the site. We massage that data to be\n * usable by our Dropdown.\n *\n */\nfunction getCountries() {\n\n const countries = [];\n\n if ( BlockVisibilityGeolocation.countries.length === 0 ) {\n return [ {\n label: __( 'No countries found.', 'content-visibility' ),\n value: 0,\n notes: '',\n } ]\n }\n\n for ( const country in BlockVisibilityGeolocation.countries ) {\n \n countries.push( { \n icon: BlockVisibilityGeolocation.countries[country].flag,\n label: BlockVisibilityGeolocation.countries[country].name,\n value: BlockVisibilityGeolocation.countries[country].code,\n } );\n \n }\n\n return countries;\n\n}// end getCountries()\n\nfunction ContentVisibilityGeolocationBodyControl( { instanceId, props } ) {\n\n const data = getCountries();\n const type = 'geolocation';\n\n let hasRulesClass = ( hasRules( props, type ) ) ? ' has-active-rules' : '';\n\n return (\n <PanelBody\n title={ __( 'Geolocation', 'content-visibility-geolocation' ) }\n initialOpen={ false }\n className={\"content-visibility-control-panel content-visibility-geolocation-controls\" + hasRulesClass}\n >\n <PanelRow>\n <ContentVisibilityGeolocationMultiSelect data={ data } labelledBy=\"Select Specific Users\" props={ props } type={ type } />\n </PanelRow>\n\n { props.attributes.contentVisibility && (\n <p className=\"geolocation-help-intro content-visibility-help-text\">{ __( 'Select one or more countries to whom this block will be ' + props.attributes.contentVisibility + '. If no countries are selected, this block will be ' + props.attributes.contentVisibility + ' regardless of a user\\'s location.', 'content-visibility-geolocation' ) }</p>\n ) }\n </PanelBody>\n );\n\n}\n\nexport default withInstanceId( ContentVisibilityGeolocationBodyControl );","import { Fill, Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\nimport ContentVisibilityGeolocationPanelBodyControl from './content-visibility-geolocation-panel-body';\n\nexport function ContentVisibilityGeolocationControl( data ) {\n\n let { props } = { ...data };\n\n let rulesEnabled = props.attributes.contentVisibilityRules.contentVisibilityRulesEnabled;\n let contentVisibility = props.attributes.hasOwnProperty( 'contentVisibility' );\n\n if ( ! rulesEnabled || ! contentVisibility ) {\n return (\n <Disabled><ContentVisibilityGeolocationPanelBodyControl props={ props } /></Disabled>\n );\n }\n\n return (\n <ContentVisibilityGeolocationPanelBodyControl props={ props } />\n );\n\n}\n\n/**\n * Render the <ContentVisibilityGeolocationControl> component by adding\n * it to the block-visibility-extra-controls Fill.\n *\n * @return {Object} A Fill component wrapping the ContentVisibilityGeolocationControl component.\n */\nfunction ContentVisibilityGeolocationFill() {\n return (\n <Fill name=\"content-visibility-extra-controls\">\n {\n ( fillProps ) => {\n return (\n <ContentVisibilityGeolocationControl props={ fillProps } />\n )\n }\n }\n </Fill>\n );\n\n}\n\n// Add our component to the Slot provided by BlockVisibilityControls\nregisterPlugin( 'content-visibility-05-geolocation-fill', { render: ContentVisibilityGeolocationFill } );\n\n\n// Register our visibility rule with the main plugin\naddFilter( 'contentVisibility.defaultContentVisibilityRules', 'content-visibility-geolocation/block-visibility-rules', registerContentVisibilityRule );\n\nfunction registerContentVisibilityRule( defaultRules ) {\n\n defaultRules.geolocation = {};\n\n return defaultRules;\n\n}\n","// extracted by mini-css-extract-plugin","import { applyFilters } from '@wordpress/hooks';\n\n/**\n * Determine if the passed block props contain rules of the passed type.\n *\n * @param {object} props The currently selected block's props.\n * @param {string} type The type of the rules i.e. userAuthenticated or specialPage (or ones from add-ons).\n *\n * @return {bool} true if the passed props contain non-empty rules of the passed type. False otherwise.\n */\n function hasRules( props, type ) {\n\n if ( ! props.attributes.contentVisibilityRules ) {\n return false;\n }\n\n if ( ! props.attributes.contentVisibilityRules[type] ) {\n return false;\n }\n\n // Default to false. Passed through a filter later.\n let hasRules = false;\n\n switch ( type ) {\n \n case 'geolocation':\n\n if ( props.attributes.contentVisibilityRules[type] && props.attributes.contentVisibilityRules[type][type] && props.attributes.contentVisibilityRules[type][type].length >= 1 ) {\n hasRules = true;\n }\n\n break;\n\n default:\n break;\n }\n\n return applyFilters( 'content-visibility-has-rules', hasRules, props, type );\n\n}// end hasRules()\n\nexport default hasRules;","import './editor.scss';\nimport './style.scss';\n\nimport ContentVisibilityGeolocationControl from './controls/content-visibility-geolocation';","(function() { module.exports = this[\"wp\"][\"components\"]; }());","(function() { module.exports = this[\"wp\"][\"compose\"]; }());","(function() { module.exports = this[\"wp\"][\"element\"]; }());","(function() { module.exports = this[\"wp\"][\"hooks\"]; }());","(function() { module.exports = this[\"wp\"][\"i18n\"]; }());","(function() { module.exports = this[\"wp\"][\"plugins\"]; }());","(function() { module.exports = this[\"React\"]; }());"],"sourceRoot":""} -
content-visibility-geolocation/trunk/content-visibility-geolocation.php
r2510965 r2568524 12 12 * Plugin URI: https://richardtape.com/content-visibility/ 13 13 * Description: [Content Visibility Add-On] Show or hide your blocks to visitors from specific countries. 14 * Version: 0.1. 014 * Version: 0.1.1 15 15 * Author: Richard Tape 16 16 * Author URI: https://richardtape.com -
content-visibility-geolocation/trunk/readme.txt
r2510965 r2568524 2 2 Contributors: iamfriendly 3 3 Donate link: https://girlswhocode.com/ 4 Tags: block, content, visibility, geolocation, location, contentvisibility4 Tags: contentvisibility, block, content, visibility, geolocation, location 5 5 Requires at least: 5.0 6 Tested up to: 5. 7.07 Stable tag: 0.1. 06 Tested up to: 5.8.0 7 Stable tag: 0.1.1 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 51 51 == Changelog == 52 52 53 = 0.1.1 = 54 * Added indicator to show when a country is selected to more easily determine when a block has rules. 55 * WP 5.8.0 compatibility. 56 53 57 = 0.1.0 = 54 58 * First public release.
Note: See TracChangeset
for help on using the changeset viewer.