/*! For license information please see shipping-settings-region-picker.js.LICENSE.txt */
(()=>{"use strict";var e={94931:(e,o,t)=>{var r=t(51609),n=Symbol.for("react.element"),i=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};o.jsx=function(e,o,t){var r,a={},c=null,p=null;for(r in void 0!==t&&(c=""+t),void 0!==o.key&&(c=""+o.key),void 0!==o.ref&&(p=o.ref),o)i.call(o,r)&&!s.hasOwnProperty(r)&&(a[r]=o[r]);if(e&&e.defaultProps)for(r in o=e.defaultProps)void 0===a[r]&&(a[r]=o[r]);return{$$typeof:n,type:e,key:c,ref:p,props:a,_owner:l.current}}},39793:(e,o,t)=>{e.exports=t(94931)},51609:e=>{e.exports=window.React}},o={};const t=window.wp.element,r=window.wp.htmlEntities,n=window.wc.components,i=window.wp.i18n;var l=function t(r){var n=o[r];if(void 0!==n)return n.exports;var i=o[r]={exports:{}};return e[r](i,i.exports,t),i.exports}(39793);const s="__WC_TREE_SELECT_COMPONENT_ROOT__",a=({options:e,initialValues:o})=>{const[r,a]=(0,t.useState)(o.length?o:[s]);return(0,l.jsx)(n.TreeSelectControl,{value:r,onChange:e=>{e=0===e.length||e[e.length-1]===s?[s]:e.filter((e=>e!==s)),document.body.dispatchEvent(new CustomEvent("wc_region_picker_update",{detail:e})),a(e)},options:e,placeholder:(0,i.__)("Start typing to filter zones","woocommerce"),alwaysShowPlaceholder:!0,selectAllLabel:(0,i.__)("Everywhere","woocommerce"),individuallySelectParent:!0,maxVisibleTags:5})},c=(e,o)=>Array.isArray(e)?e.map((e=>c(e,o))):(e.label&&(e.label=o(e.label)),e.children&&(e.children=c(e.children,o)),e),p=document.getElementById("wc-shipping-zone-region-picker-root"),d=c(window.shippingZoneMethodsLocalizeScript?.region_options,r.decodeEntities)??[],w=window.shippingZoneMethodsLocalizeScript?.locations??[],_=()=>(0,l.jsx)("div",{children:(0,l.jsx)(a,{options:d,initialValues:w})});p&&(0,t.createRoot)(p).render((0,l.jsx)(_,{})),(window.wc=window.wc||{}).shippingSettingsRegionPicker={}})();